Skip to content
Snippets Groups Projects
Commit 5db396f5 authored by Haakon Gunleiksrud's avatar Haakon Gunleiksrud
Browse files

Merge branch '25-gameware' into 'dev'

Resolve "GameWare"

Closes #25

See merge request !13
parents 6ed9c87f 07a79591
No related branches found
No related tags found
1 merge request!13Resolve "GameWare"
......@@ -3,31 +3,51 @@ package com.gameware.game;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.gameware.game.states.GameStateManager;
public class GameWare extends ApplicationAdapter {
SpriteBatch batch;
Texture img;
public static final int WIDTH = 480;
public static final int HEIGHT = 800;
public static final String TITLE = "WackyWare!";
private GameStateManager gsm;
private SpriteBatch batch;
// private Music music;
private static GameWare instance = null;
//Singleton (lazy initialization)
public static GameWare getInstance(){
if( instance == null){
instance = new GameWare();
}
return instance;
}
@Override
public void create () {
gsm = new GameStateManager();
batch = new SpriteBatch();
img = new Texture("badlogic.jpg");
//music = Gdx.audio.newMusic(Gdx.files.internal(("music.mp3")));
//music.setLooping(true);
//music.setVolume(0.1f);
//music.play();
//gsm.push(LoginState.getInstance(gsm));
}
@Override
public void render () {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(img, 0, 0);
batch.end();
gsm.update(Gdx.graphics.getDeltaTime());
gsm.render(batch);
}
@Override
public void dispose () {
batch.dispose();
img.dispose();
// music.dispose();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment