From 876bf2461813efe7959c04d7fe8332c9e8130d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B5=A9=E4=B9=90?= Date: Wed, 6 Jan 2016 19:36:26 +0800 Subject: [PATCH] =?UTF-8?q?NPC=E6=A0=B9=E6=8D=AE=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E6=96=B9=E5=90=91=E8=B0=83=E6=95=B4=E7=9B=AE=E5=85=89=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 4afcb09..d0a816a 100644 --- a/index.js +++ b/index.js @@ -430,38 +430,47 @@ context.fill(); context.closePath(); context.fillStyle = '#000'; - switch(this.times%4){ - case 2: + switch(this.orientation){ case 0: 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.closePath(); 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.closePath(); break; case 1: 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.closePath(); 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.closePath(); break; case 3: 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(); 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.closePath(); - break; + break; } } });