Cycle through levels when player hits the "restart level" button.

GitOrigin-RevId: bbe909515fbc4b61be3357e506a113e82bb6e2bd
This commit is contained in:
Colin McMillen 2020-02-19 15:06:52 -05:00
parent 6b9aa0844c
commit b858c45b7e

View File

@ -24,6 +24,7 @@ namespace SemiColinGames {
// attempt to draw the scene. This is a workaround for the fact that otherwise the first few // attempt to draw the scene. This is a workaround for the fact that otherwise the first few
// frames can be really slow to draw. // frames can be really slow to draw.
int framesToSuppress; int framesToSuppress;
int levelIdx = 0;
Scene scene; Scene scene;
Player player; Player player;
@ -72,8 +73,9 @@ namespace SemiColinGames {
framesToSuppress = 2; framesToSuppress = 2;
camera = new Camera(); camera = new Camera();
player = new Player(); player = new Player();
world = new World(Levels.ONE_ONE); world = new World(Levels.ALL_LEVELS[levelIdx % Levels.ALL_LEVELS.Length]);
scene = new Scene(GraphicsDevice, camera); scene = new Scene(GraphicsDevice, camera);
levelIdx++;
} }
// Called once per game. Unloads all game content. // Called once per game. Unloads all game content.