NPC根据移动方向调整目光位置
This commit is contained in:
parent
c1d10d44e4
commit
876bf24618
27
index.js
27
index.js
@ -430,38 +430,47 @@
|
|||||||
context.fill();
|
context.fill();
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.fillStyle = '#000';
|
context.fillStyle = '#000';
|
||||||
switch(this.times%4){
|
switch(this.orientation){
|
||||||
case 2:
|
|
||||||
case 0:
|
case 0:
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(this.x-this.width*.15,this.y-this.height*.27,this.width*.07,0,2*Math.PI,false);
|
context.arc(this.x-this.width*.15,this.y-this.height*.25,this.width*.07,0,2*Math.PI,false);
|
||||||
context.fill();
|
context.fill();
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(this.x+this.width*.15,this.y-this.height*.27,this.width*.07,0,2*Math.PI,false);
|
context.arc(this.x+this.width*.15,this.y-this.height*.25,this.width*.07,0,2*Math.PI,false);
|
||||||
context.fill();
|
context.fill();
|
||||||
context.closePath();
|
context.closePath();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(this.x-this.width*.17,this.y-this.height*.25,this.width*.07,0,2*Math.PI,false);
|
context.arc(this.x-this.width*.11,this.y-this.height*.21,this.width*.07,0,2*Math.PI,false);
|
||||||
context.fill();
|
context.fill();
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(this.x+this.width*.13,this.y-this.height*.25,this.width*.07,0,2*Math.PI,false);
|
context.arc(this.x+this.width*.19,this.y-this.height*.21,this.width*.07,0,2*Math.PI,false);
|
||||||
|
context.fill();
|
||||||
|
context.closePath();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
context.beginPath();
|
||||||
|
context.arc(this.x-this.width*.15,this.y-this.height*.16,this.width*.07,0,2*Math.PI,false);
|
||||||
|
context.fill();
|
||||||
|
context.closePath();
|
||||||
|
context.beginPath();
|
||||||
|
context.arc(this.x+this.width*.15,this.y-this.height*.16,this.width*.07,0,2*Math.PI,false);
|
||||||
context.fill();
|
context.fill();
|
||||||
context.closePath();
|
context.closePath();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(this.x-this.width*.13,this.y-this.height*.25,this.width*.07,0,2*Math.PI,false);
|
context.arc(this.x-this.width*.19,this.y-this.height*.21,this.width*.07,0,2*Math.PI,false);
|
||||||
context.fill();
|
context.fill();
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(this.x+this.width*.17,this.y-this.height*.25,this.width*.07,0,2*Math.PI,false);
|
context.arc(this.x+this.width*.11,this.y-this.height*.21,this.width*.07,0,2*Math.PI,false);
|
||||||
context.fill();
|
context.fill();
|
||||||
context.closePath();
|
context.closePath();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user