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/Game.java

66 lines
1.4 KiB
Java
Raw Normal View History

2016-02-08 18:08:43 +00:00
package com.game;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.game.Misc.Vars;
import com.game.States.StateManager;
public class Game extends ApplicationAdapter {
private float accum;
private SpriteBatch sb;
private OrthographicCamera cam;
private OrthographicCamera hudCam;
private StateManager sm;
@Override
public void create () {
sb = new SpriteBatch();
cam = new OrthographicCamera();
cam.setToOrtho(false, Vars.SCREEN_WIDTH, Vars.SCREEN_HEIGHT);
hudCam = new OrthographicCamera();
hudCam.setToOrtho(false, Vars.SCREEN_WIDTH, Vars.SCREEN_HEIGHT);
sm = new StateManager(this);
}
@Override
public void resize (int width, int height) {
}
@Override
public void render () {
accum += Gdx.graphics.getDeltaTime();
while (accum >= Vars.STEP) {
accum -= Vars.STEP;
2016-02-09 00:05:48 +00:00
sm.handleInput();
2016-02-08 18:08:43 +00:00
sm.update(Vars.STEP);
sm.render();
}
}
@Override
public void pause () {
}
@Override
public void resume () {
}
@Override
public void dispose () {
sm.dispose();
}
public SpriteBatch getSpriteBatch() { return sb; }
public OrthographicCamera getCam() { return cam; }
public OrthographicCamera getHudCam() { return hudCam; }
}