📜  使对象向播放器 p5js 移动 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:20.136000             🧑  作者: Mango

代码示例1
this.rotation = atan2(player.y - this.y, player.x - this.y);
this.speed = 2.5;

this.x += cos(this.rotation) * this.speed;
this.y += sin(this.rotation) * this.speed;