Advertisement
Guest User

MyGdxGame

a guest
May 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. package com.mygdx.game;
  2.  
  3. import com.badlogic.gdx.ApplicationAdapter;
  4. import com.badlogic.gdx.graphics.OrthographicCamera;
  5. import com.badlogic.gdx.graphics.g2d.SpriteBatch;
  6.  
  7. public class MyGdxGame extends ApplicationAdapter {
  8.  
  9.  
  10.     public static OrthographicCamera camera;
  11.     public  int gamestate=1;
  12.  
  13.     public static MapManager mapManager;
  14.  
  15.     public void update_game()
  16.     {
  17.         /*
  18.         if (gamestate == 0) {
  19.             zastavka.update();
  20.         }
  21.         */
  22.  
  23.         if (gamestate == 1) {
  24.  
  25.             game.update();
  26.         }
  27.     }
  28.  
  29.     public void display_game() {
  30.  
  31. /*
  32.         if (gamestate == 0) {
  33.             zastavka.display();
  34.         }
  35.         */
  36.  
  37.         if (gamestate == 1) {
  38.  
  39.             game.display();
  40.         }
  41.     }
  42.  
  43.  
  44.  
  45.  
  46.     public  GAME game;
  47.     public  SpriteBatch batch;
  48.  
  49.     @Override
  50.     public void create () {
  51.         mapManager=new MapManager();
  52.         camera = new OrthographicCamera();
  53.         camera.setToOrtho(false,320,240);
  54.  
  55.         game= new GAME();
  56.         batch = new SpriteBatch(1000);
  57.  
  58.     }
  59.  
  60.     @Override
  61.     public void render () {
  62.         update_game();
  63.  
  64.         display_game();
  65.     }
  66.    
  67.     @Override
  68.     public void dispose () {
  69.         batch.dispose();
  70.  
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement