This repository has been archived on 2022-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
EEEEEEEEEEEEEEEAAAAAAAAAA-A.../core/src/com/game/App.java

63 lines
1.2 KiB
Java
Raw Normal View History

2016-02-08 18:08:43 +00:00
package com.game;
import com.badlogic.gdx.Game;
2016-02-08 18:08:43 +00:00
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.assets.AssetManager;
2016-02-08 18:08:43 +00:00
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
2016-02-12 23:23:59 +00:00
import com.game.managers.ScreenManager;
2016-02-13 15:47:03 +00:00
import com.game.screens.AbstractScreen;
2016-02-12 23:23:59 +00:00
import com.game.screens.Menu;
2016-02-13 15:47:03 +00:00
import com.game.screens.Play;
2016-02-08 18:08:43 +00:00
public class App extends Game {
2016-02-08 18:08:43 +00:00
2016-02-12 23:23:59 +00:00
// Managers
2016-02-13 15:47:03 +00:00
public static AssetManager assets;
2016-02-12 23:23:59 +00:00
public ScreenManager sm;
// Batches
2016-02-12 23:23:59 +00:00
public SpriteBatch sb;
public ShapeRenderer sr;
// Cameras
2016-02-12 19:13:05 +00:00
//private OrthographicCamera cam;
//private OrthographicCamera hudCam;
2016-02-08 18:08:43 +00:00
2016-02-12 23:23:59 +00:00
2016-02-08 18:08:43 +00:00
@Override
public void create() {
2016-02-12 23:23:59 +00:00
// Create managers
assets = new AssetManager();
sm = new ScreenManager(this);
// Create batches
2016-02-08 18:08:43 +00:00
sb = new SpriteBatch();
sr = new ShapeRenderer();
2016-02-12 19:13:05 +00:00
sr.setAutoShapeType(true);
2016-02-08 18:08:43 +00:00
2016-02-12 23:23:59 +00:00
sm.setScreen(ScreenManager.Screen.LOADING);
2016-02-08 18:08:43 +00:00
}
@Override
public void render () {
super.render();
2016-02-08 18:08:43 +00:00
}
@Override
public void dispose () {
super.dispose();
2016-02-12 19:13:05 +00:00
sb.dispose();
sr.dispose();
2016-02-12 23:23:59 +00:00
assets.dispose();
sm.dispose();
2016-02-08 18:08:43 +00:00
}
public SpriteBatch getSpriteBatch() { return sb; }
public ShapeRenderer getSr() { return sr; }
2016-02-12 23:23:59 +00:00
public AssetManager getAssetManager() { return assets; }
2016-02-08 18:08:43 +00:00
}