public void init() { switch (CurrentLevel) { case Level.LEVEL1: level1.init(); break; case Level.LEVEL2: level2.init(); break; } }
public void render(GameTime gameTime, SpriteBatch batch) { switch (CurrentLevel) { case Level.LEVEL1: if (!Level1.initialized) { level1.init(); } level1.render(gameTime, batch); break; case Level.LEVEL2: if (!Level2.initialized) { level2 = new Level2(); level2.init(); } level2.render(gameTime, batch); break; } }