updated 起始画面Pacman咬合动画优化

This commit is contained in:
mumuy 2017-04-13 11:30:38 +08:00
parent cd99f67af2
commit 7a30cfa187

View File

@ -55,15 +55,12 @@
y:game.height*.45,
width:100,
height:100,
frames:10,
frames:3,
draw:function(context){
var t = Math.abs(5-this.times%10);
context.fillStyle = '#FFE600';
context.beginPath();
if(this.times%2){
context.arc(this.x,this.y,this.width/2,.20*Math.PI,1.80*Math.PI,false);
}else{
context.arc(this.x,this.y,this.width/2,.01*Math.PI,1.99*Math.PI,false);
}
context.arc(this.x,this.y,this.width/2,t*.04*Math.PI,(2-t*.04)*Math.PI,false);
context.lineTo(this.x,this.y);
context.closePath();
context.fill();