2016-02-08 18:08:43 +00:00
|
|
|
package com.game;
|
|
|
|
|
2016-02-11 18:35:15 +00:00
|
|
|
import com.badlogic.gdx.Game;
|
2016-02-08 18:08:43 +00:00
|
|
|
import com.badlogic.gdx.Gdx;
|
2016-02-10 18:21:32 +00:00
|
|
|
import com.badlogic.gdx.Input;
|
2016-02-11 18:35:15 +00:00
|
|
|
import com.badlogic.gdx.assets.AssetManager;
|
2016-02-08 18:08:43 +00:00
|
|
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
2016-02-10 18:21:32 +00:00
|
|
|
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
2016-02-12 23:23:59 +00:00
|
|
|
import com.game.managers.ScreenManager;
|
|
|
|
import com.game.screens.Menu;
|
2016-02-08 18:08:43 +00:00
|
|
|
|
2016-02-11 18:35:15 +00:00
|
|
|
public class App extends Game {
|
2016-02-08 18:08:43 +00:00
|
|
|
|
2016-02-12 23:23:59 +00:00
|
|
|
// Managers
|
|
|
|
public AssetManager assets;
|
|
|
|
public ScreenManager sm;
|
|
|
|
|
2016-02-08 18:08:43 +00:00
|
|
|
|
2016-02-10 18:21:32 +00:00
|
|
|
// Batches
|
2016-02-12 23:23:59 +00:00
|
|
|
public SpriteBatch sb;
|
|
|
|
public ShapeRenderer sr;
|
2016-02-10 18:21:32 +00:00
|
|
|
|
|
|
|
// 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
|
2016-02-09 13:12:43 +00:00
|
|
|
public void create() {
|
2016-02-12 23:23:59 +00:00
|
|
|
// Create managers
|
|
|
|
assets = new AssetManager();
|
|
|
|
sm = new ScreenManager(this);
|
2016-02-10 18:21:32 +00:00
|
|
|
|
|
|
|
// Create batches
|
2016-02-08 18:08:43 +00:00
|
|
|
sb = new SpriteBatch();
|
2016-02-10 18:21:32 +00:00
|
|
|
sr = new ShapeRenderer();
|
2016-02-12 19:13:05 +00:00
|
|
|
sr.setAutoShapeType(true);
|
2016-02-08 18:08:43 +00:00
|
|
|
|
2016-02-10 18:21:32 +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 () {
|
2016-02-10 18:21:32 +00:00
|
|
|
super.render();
|
2016-02-08 18:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void dispose () {
|
2016-02-11 18:35:15 +00:00
|
|
|
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; }
|
2016-02-10 18:21:32 +00:00
|
|
|
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
|
|
|
}
|