cc.Class({
extends: cc.Component,
properties: {
angle: 30,
speed:20,
},
update(dt) {
this.node.x = this.node.x + (this.speed * Math.cos(this.angle));
this.node.y = this.node.y + (this.speed * Math.sin(this.angle));
},});
角度angle=0的时候貌似正常,其他角度都是乱的