摘要:
// 三角函数 得出鱼要旋转的角度
this.fish.rotation = Math.atan2(pointer.y - this.fish.y, pointer.x - this.fish.x);
// 判断鱼是否需要反转:点击的位置和鱼头相同=>不反转
if ((pointer.x > this.fish.x)) {
console.log("点击的位置和鱼头相同=>不反转");
this.fish.flipY = false;
}
// 判断鱼是否需要反转:点击的位置和鱼头相反=>反转
阅读全文
// 三角函数 得出鱼要旋转的角度
this.fish.rotation = Math.atan2(pointer.y - this.fish.y, pointer.x - this.fish.x);
// 判断鱼是否需要反转:点击的位置和鱼头相同=>不反转
if ((pointer.x > this.fish.x)) {
console.log("点击的位置和鱼头相同=>不反转");
this.fish.flipY = false;
}
// 判断鱼是否需要反转:点击的位置和鱼头相反=>反转
阅读全文
posted @ 2018-11-15 13:19
布袋
阅读(1179)
评论(0)
推荐(0)

浙公网安备 33010602011771号