Guest User

Untitled

a guest
Apr 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.20 KB | None | 0 0
  1. @Override
  2.     public void render() {
  3.        
  4.         // update the game state
  5.         gameState.update();
  6.        
  7.         // render the current game state
  8.         gameState.render();
  9.        
  10.         // when the gameState is done we change to the next gameState
  11.         if( gameState.isDone() )
  12.         {
  13.             // dispose the current screen
  14.             gameState.dispose();
  15.  
  16.             // Splash screen
  17.             if(gameState.getNextGameState() == "SplashScreen")
  18.             {
  19.                 myRequestHandler.showAds(false);
  20.                 gameState = new SplashScreen();
  21.             }
  22.             else if(gameState.getNextGameState() == "MainMenu")
  23.             {
  24.                 myRequestHandler.showAds(true);
  25.                 gameState = new MainMenu(adHeight);
  26.             }
  27.             else if(gameState.getNextGameState().startsWith("TrackPicker/"))
  28.             {
  29.                 myRequestHandler.showAds(true);
  30.                 gameState = new TrackManager(gameState.getNextGameState().split("/")[1], adHeight);
  31.             }
  32.             else if(gameState.getNextGameState().startsWith("TrackEditor/"))
  33.             {
  34.                 gameState = new TrackEditor(gameState.getNextGameState().split("/")[1]);
  35.                 myRequestHandler.showAds(false);
  36.             }
  37.             else if(gameState.getNextGameState() ==  "Options")
  38.             {
  39.                 myRequestHandler.showAds(true);
  40.                 gameState = new Options(adHeight);
  41.             }
  42.             else if(gameState.getNextGameState().startsWith("Race/"))
  43.             {
  44.                 myRequestHandler.showAds(false);
  45.                 gameState = new Race(gameState.getNextGameState().split("/")[1]);
  46.             }
  47.             else if(gameState.getNextGameState() == "CustomizeMenu")
  48.             {
  49.                 myRequestHandler.showAds(true);
  50.                 gameState = new CustomizeMenu(adHeight);
  51.             }
  52.             else if(gameState.getNextGameState() == "ProfileManager")
  53.             {
  54.                 myRequestHandler.showAds(true);
  55.                 gameState = new ProfileManager(adHeight);
  56.             }
  57.             else if(gameState.getNextGameState() == "BikeManager")
  58.             {
  59.                 myRequestHandler.showAds(true);
  60.                 gameState = new BikeManager(adHeight);
  61.             }
  62.             else if(gameState.getNextGameState() == "RiderManager")
  63.             {
  64.                 myRequestHandler.showAds(true);
  65.                 gameState = new RiderManager(adHeight);
  66.             }
  67.             else if(gameState.getNextGameState() == "Exit")
  68.             {
  69.                 myRequestHandler.showAds(false);
  70.                 System.exit(0);
  71.             }else
  72.             {
  73.                 myRequestHandler.showAds(false);
  74.                 System.exit(0);
  75.             }
  76.            
  77.             Gdx.input.setInputProcessor((InputProcessor)gameState);
  78.         }
  79.        
  80.     }
Add Comment
Please, Sign In to add comment