public virtual void Move() { Velocity = Vector2.Zero; if (Keyboard.GetState().IsKeyDown(Input.Up)) { Speed = General.GameSpeed; Velocity.Y = -Speed; Direction = General.eDirection.Up; LastDirection = Direction; } else if (Keyboard.GetState().IsKeyDown(Input.Down)) { Speed = General.GameSpeed; Velocity.Y = Speed; Direction = General.eDirection.Down; LastDirection = Direction; } else if (Keyboard.GetState().IsKeyDown(Input.Left)) { Speed = General.GameSpeed; Velocity.X = -Speed; Direction = General.eDirection.Left; LastDirection = Direction; } else if (Keyboard.GetState().IsKeyDown(Input.Right)) { Speed = General.GameSpeed; Velocity.X = Speed; Direction = General.eDirection.Right; LastDirection = Direction; } }
public virtual void Stop(Point current) { Direction = General.eDirection.Idle; Speed = 0f; Velocity = Vector2.Zero; }