public void AdvanceLevel()\r
{\r
// TODO: Load the next map, etc...\r
+ //TODO somehow get next map\r
+ State.Entities.Clear();\r
+ String nextMap = State.Map.Next;\r
+ State.Map = mContentManager.Load<Map>("Maps/"+nextMap);\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(this);\r
}\r
\r
/// <summary>\r
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(this);\r
}\r
public void LoadContent(ContentManager contentManager)\r
{\r
/// Get the grid coordinates where the object is at or\r
/// is moving to.\r
/// </summary>\r
- public Point Coordinates { get { return mCoordinates; } }\r
+ public Point Coordinates { get { return mCoordinates; } set { mCoordinates = value; } }\r
\r
/// <summary>\r
/// Get and set the speed of movement in grid cells / second.\r
public Point Coordinates { get { return mMotion.Coordinates; }\r
set\r
{\r
- Coordinates = value;\r
+ mMotion.Coordinates = value;\r
mMotion = new MovementManager(value, basePlayerSpeed);\r
} }\r
public char Identifier { get { return mPlayerIndex.ToString()[0]; } }\r