2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Content;
7 using Microsoft.Xna.Framework.Graphics;
8 using Microsoft.Xna.Framework.Input;
12 public class Human : IPlayer
30 public Human(Map _theMap, String Name)
35 movementSpeed = 20; // randomly set now
41 public void LoadContent(ContentManager contentManager, GraphicsDeviceManager graphics)
43 charModel = contentManager.Load<Texture2D>("deselectBox"); //change to charModel when designed
46 public void UnloadContent()
51 public long Update(GameTime gameTime, NetworkManager networkGame)
57 public long Draw(SpriteBatch spriteBatch)
62 public int Health { get { return health; } }
63 public int Score { get { return score; } }
64 public bool alive { get { return health > 0; } }
66 public void causeDamageTo(int amount)
72 /// Moves the current player being controlled based on a given set of key presses.
73 /// The player can only move one grid space per movePlayer call. Thus this method
74 /// is made to be called ever update. The player will only move if the grid space
75 /// that is being moved to is an open space.
77 /// <param name="keysPressed">A general list of keys that are pressed. Other keys can be included but only direction keys will be used</param>
78 public void MovePlayer(List<Keys> keysPressed)
81 keysPressed.Contains<Keys>(Keys.Left);
82 if (keysPressed.Contains<Keys>(Keys.Up) && keysPressed.Contains<Keys>(Keys.Left) && theMap.IsCellOpen(gridX - 1, gridY - 1))
88 else if (keysPressed.Contains<Keys>(Keys.Up) && keysPressed.Contains<Keys>(Keys.Right) && theMap.IsCellOpen(gridX + 1, gridY - 1))
94 else if (keysPressed.Contains<Keys>(Keys.Down) && keysPressed.Contains<Keys>(Keys.Left) && theMap.IsCellOpen(gridX - 1, gridY + 1))
100 else if (keysPressed.Contains<Keys>(Keys.Down) && keysPressed.Contains<Keys>(Keys.Right) && theMap.IsCellOpen(gridX + 1, gridY + 1))
106 else if (keysPressed.Contains<Keys>(Keys.Up) && theMap.IsCellOpen(gridX, gridY - 1))
111 else if (keysPressed.Contains<Keys>(Keys.Down) && theMap.IsCellOpen(gridX, gridY + 1))
116 else if (keysPressed.Contains<Keys>(Keys.Left) && theMap.IsCellOpen(gridX - 1, gridY))
121 else if (keysPressed.Contains<Keys>(Keys.Right) && theMap.IsCellOpen(gridX + 1, gridY))
128 public void powerUp(int amount)
133 public void Spawn(Point mapPoint)