坐标初始化了之后并没有中心合并在一起。所以我自己调了参数
ctx1.translate(this.x,this.y);
ctx1.drawImage(this.bigEye,this.bigEye.width*0.5+40,-this.bigEye.height*0.5);
ctx1.drawImage(this.bigBody,this.bigBody.width*0.5,-this.bigBody.height*0.5);
ctx1.drawImage(this.bigTail,this.bigTail.width*0.5+48,-this.bigTail.height*0.5);
ctx1.translate(this.x,this.y);
ctx1.drawImage(this.bigEye,this.bigEye.width*0.5+40,-this.bigEye.height*0.5);
ctx1.drawImage(this.bigBody,this.bigBody.width*0.5,-this.bigBody.height*0.5);
ctx1.drawImage(this.bigTail,this.bigTail.width*0.5+48,-this.bigTail.height*0.5);
最新回答 / 慕移动0737724
课程里有介绍啊,ctx1.rotate(this.angle);这行代码加了么?前面代码这样的//Math.atan2(y, x) var deltaY = mom.y - this.y; var deltaX = mom.x - this.x; var beta = Math.atan2(deltaY, deltaX) + Math.PI;//-PI/2, PI/2 //lerp angle this.angle = lerpAngle(beta, this.angle, ...
2017-10-14