1
我已经距离函数返回谁:distance
是这样的:15,10,等 这里功能:HTML5画布距离和移动对象
var Distance = function(other) {
var xd = other.x - this.x;
var yd = other.y - this.y;
return Math.sqrt(xd * xd + yd * yd);
};
,并有子弹的功能谁在this.x = 10; this.y = 10;
但如何移动我的子弹与距离?当Towers射击敌人时,就像在塔防游戏中一样?
感谢和抱歉我的英语语言不好。