public Game()\r
{\r
\r
+ }\r
+ /// <summary>\r
+ /// This method should be called whenever the players want to move to a new map.\r
+ /// Not implemented yet. Need some way to get next map.\r
+ /// </summary>\r
+ public void startNewMap()\r
+ {\r
+ //TODO somehow get next map\r
+ State.Entities.Clear();\r
+ //State.Map = State.Map.getNextMap();\r
+ for (int i = 0; i < State.mCharacters.Length; i++)\r
+ {\r
+ State.mCharacters[i].Coordinates = State.Map.GetStartingPositionForPlayer(i + 1);\r
+ }\r
+ State.Entities = State.Map.GetAllEntities();\r
}\r
public void LoadContent(ContentManager contentManager)\r
{\r
if (State.mCharacters[i] == null)\r
{\r
allCharactersSelected = false;\r
- if (State.GetKeysDown(i).Contains(Keys.Enter))\r
+ if (State.GetKeysDown(i).Contains(Keys.M))\r
+ {\r
+ State.mCharacters[i] = new Melee(this, "", State.Map.GetStartingPositionForPlayer(i + 1), i);\r
+ State.mCharacters[i].LoadContent(mContentManager);\r
+ }\r
+ else if (State.GetKeysDown(i).Contains(Keys.R))\r
{\r
State.mCharacters[i] = new Ranged(this, "", State.Map.GetStartingPositionForPlayer(i + 1), i);\r
State.mCharacters[i].LoadContent(mContentManager);\r
else\r
{\r
spriteBatch.GraphicsDevice.Clear(Color.Black);\r
- spriteBatch.DrawString(menu, "Press Enter To Select A Character", new Vector2(30, 30), Color.RosyBrown);\r
+ spriteBatch.DrawString(menu, "Press R to select a Ranged Character and M to select a Melee Character", new Vector2(30, 30), Color.RosyBrown);\r
}\r
return CurrentFrameNumber;\r
}\r
{\r
#region Member variables\r
//The number of frames between each projectile is spawned.\r
+ const float basePlayerSpeed = 4.0f;\r
const int shootCoolDown = 18;\r
String CharName;\r
Game game;\r
public MovementManager Motion { get { return mMotion; } }\r
public int PlayerIndex { get { return mPlayerIndex; } }\r
public Vector2 Position { get { return mMotion.Position; } }\r
- public Point Coordinates { get { return mMotion.Coordinates; } }\r
+ public Point Coordinates { get { return mMotion.Coordinates; } \r
+ set\r
+ {\r
+ Coordinates = value;\r
+ mMotion = new MovementManager(value, basePlayerSpeed);\r
+ } }\r
public int Damage { get { return playerDamage; } set { playerDamage = value; } }\r
#endregion\r
\r