From 7a30cfa1875a71eaad72284d65b30c13d8896107 Mon Sep 17 00:00:00 2001 From: mumuy Date: Thu, 13 Apr 2017 11:30:38 +0800 Subject: [PATCH] =?UTF-8?q?updated=20=E8=B5=B7=E5=A7=8B=E7=94=BB=E9=9D=A2P?= =?UTF-8?q?acman=E5=92=AC=E5=90=88=E5=8A=A8=E7=94=BB=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index aec2f86..db7326d 100644 --- a/index.js +++ b/index.js @@ -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();