From 9fc306c489b446612f0fc1b363e490a5ff217d2c Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 27 Apr 2010 04:38:42 +0000 Subject: [PATCH] Reseting the map seems to be working now. git-svn-id: https://bd85.net/svn/cs3505_group@157 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- CarFire/CarFire/CarFire/Game.cs | 24 ++++++++-------------- CarFire/CarFire/CarFire/MovementManager.cs | 2 +- CarFire/CarFire/CarFire/Player.cs | 2 +- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/CarFire/CarFire/CarFire/Game.cs b/CarFire/CarFire/CarFire/Game.cs index 5650711..63ed26d 100644 --- a/CarFire/CarFire/CarFire/Game.cs +++ b/CarFire/CarFire/CarFire/Game.cs @@ -309,6 +309,15 @@ namespace CarFire public void AdvanceLevel() { // TODO: Load the next map, etc... + //TODO somehow get next map + State.Entities.Clear(); + String nextMap = State.Map.Next; + State.Map = mContentManager.Load("Maps/"+nextMap); + for (int i = 0; i < State.mCharacters.Length; i++) + { + State.mCharacters[i].Coordinates = State.Map.GetStartingPositionForPlayer(i + 1); + } + State.Entities = State.Map.GetAllEntities(this); } /// @@ -324,21 +333,6 @@ namespace CarFire public Game() { - } - /// - /// This method should be called whenever the players want to move to a new map. - /// Not implemented yet. Need some way to get next map. - /// - public void startNewMap() - { - //TODO somehow get next map - State.Entities.Clear(); - //State.Map = State.Map.getNextMap(); - for (int i = 0; i < State.mCharacters.Length; i++) - { - State.mCharacters[i].Coordinates = State.Map.GetStartingPositionForPlayer(i + 1); - } - State.Entities = State.Map.GetAllEntities(this); } public void LoadContent(ContentManager contentManager) { diff --git a/CarFire/CarFire/CarFire/MovementManager.cs b/CarFire/CarFire/CarFire/MovementManager.cs index 7d81868..ad26e47 100644 --- a/CarFire/CarFire/CarFire/MovementManager.cs +++ b/CarFire/CarFire/CarFire/MovementManager.cs @@ -44,7 +44,7 @@ namespace CarFire /// Get the grid coordinates where the object is at or /// is moving to. /// - public Point Coordinates { get { return mCoordinates; } } + public Point Coordinates { get { return mCoordinates; } set { mCoordinates = value; } } /// /// Get and set the speed of movement in grid cells / second. diff --git a/CarFire/CarFire/CarFire/Player.cs b/CarFire/CarFire/CarFire/Player.cs index e89b284..5846050 100644 --- a/CarFire/CarFire/CarFire/Player.cs +++ b/CarFire/CarFire/CarFire/Player.cs @@ -38,7 +38,7 @@ namespace CarFire public Point Coordinates { get { return mMotion.Coordinates; } set { - Coordinates = value; + mMotion.Coordinates = value; mMotion = new MovementManager(value, basePlayerSpeed); } } public char Identifier { get { return mPlayerIndex.ToString()[0]; } } -- 2.45.2