敵(座標=(x0,y0)) から自機(座標=(x1,y1))に速度 v で弾を撃ちたい。 その場合速度 vx, vy は t = atan(y1 - y0, x1 - x0) vx = cos(t) * v vy = sin(t) * v で求まります。