updated 起始画面Pacman咬合动画优化
This commit is contained in:
parent
cd99f67af2
commit
7a30cfa187
9
index.js
9
index.js
@ -55,15 +55,12 @@
|
|||||||
y:game.height*.45,
|
y:game.height*.45,
|
||||||
width:100,
|
width:100,
|
||||||
height:100,
|
height:100,
|
||||||
frames:10,
|
frames:3,
|
||||||
draw:function(context){
|
draw:function(context){
|
||||||
|
var t = Math.abs(5-this.times%10);
|
||||||
context.fillStyle = '#FFE600';
|
context.fillStyle = '#FFE600';
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
if(this.times%2){
|
context.arc(this.x,this.y,this.width/2,t*.04*Math.PI,(2-t*.04)*Math.PI,false);
|
||||||
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.lineTo(this.x,this.y);
|
context.lineTo(this.x,this.y);
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.fill();
|
context.fill();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user