SHARE
TWEET

Untitled

a guest Nov 28th, 2016 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class GameProject extends Game{
  2.  
  3.     public static final int WIDTH = 1280;
  4.     public static final int HEIGHT = 720;
  5.  
  6.     public static ActionResolver actionResolver;
  7.     private SpriteBatch batch;
  8.     private OrthographicCamera cam;
  9.  
  10.     private AssetManager manager = new AssetManager();
  11.  
  12.     public GameProject(ActionResolver actionResolver) {
  13.         super();
  14.         GameProject.actionResolver = actionResolver;
  15.     }
  16.  
  17.     @Override
  18.     public void create () {
  19.  
  20.         batch = new SpriteBatch();
  21.         cam = new OrthographicCamera();
  22.         cam.setToOrtho(false, WIDTH, HEIGHT);
  23.  
  24.         manager.load("sprites/player.png", Texture.class);
  25.         manager.load("sprites/health.png", Texture.class);
  26.     }
  27.  
  28.     public void render() {
  29.         if(manager.update()) {
  30.             setScreen(new PlayScreen(this));
  31.         }
  32.     }
  33.  
  34.     public SpriteBatch getSpriteBatch() { return batch; }
  35.     public OrthographicCamera getCamera() { return cam; }
  36.     public AssetManager getManager(){return manager;}
  37.  
  38.     public void dispose(){
  39.         batch.dispose();
  40.     }
  41.  
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top