{\r
public class Human : IPlayer\r
{\r
- public enum State\r
- {\r
- left,\r
- right,\r
- up,\r
- down\r
- };\r
//The number of frames between each projectile is spawned.\r
const int shootCoolDown = 10;\r
- State state;\r
String CharName;\r
Game game;\r
Texture2D charModel;\r
health = 100;\r
score = 0;\r
visible = false;\r
- //default state\r
- state = State.up;\r
charModel = model;\r
projectileModel = projectile;\r
projectileSpeed = 30;\r
bool moveRight = keysPressed.Contains(Keys.Right);\r
bool moveUp = keysPressed.Contains(Keys.Up);\r
bool moveDown = keysPressed.Contains(Keys.Down);\r
- if (moveLeft)\r
- state = State.left;\r
- else if (moveRight)\r
- state = State.right;\r
- else if (moveUp)\r
- state = State.up;\r
- else if (moveDown)\r
- state = State.down;\r
-\r
Point destination = MovementManager.GetNeighborCell(mMotion.Coordinates, moveLeft, moveRight, moveUp, moveDown);\r
if (!keysPressed.Contains(Keys.LeftControl))\r
{\r