public float LookAt(Point target) { Vector vector = GameHelper.GetVector(Position, target); float angle = (float)Math.Atan2(vector.Y, vector.X) * (float)(180 / Math.PI) + 90; return(angle); }
public bool MoveTowards(Point target, float speed) { Vector vector = GameHelper.GetVector(Position, target); Vector direction = new Vector(vector.X / vector.Length, vector.Y / vector.Length); if (vector.Length > speed) { Point newMoverPosition = new Point(Position.X + (direction.X * speed), Position.Y + (direction.Y * speed)); MoveToPoint(newMoverPosition); return(false); } else { return(true); } }