diff options
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/TankOnTank.java | 9 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/screens/LoadScreen.java | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/TankOnTank.java b/core/src/ch/asynk/tankontank/TankOnTank.java index 0dbe669..6d404a8 100644 --- a/core/src/ch/asynk/tankontank/TankOnTank.java +++ b/core/src/ch/asynk/tankontank/TankOnTank.java @@ -8,10 +8,12 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import ch.asynk.tankontank.screens.LoadScreen; +import ch.asynk.tankontank.game.Factory; public class TankOnTank extends Game { public AssetManager manager; + public Factory factory; public Skin skin; @Override @@ -21,10 +23,10 @@ public class TankOnTank extends Game Gdx.app.debug("TankOnTank", "create() [" + Gdx.graphics.getWidth() + ";" + Gdx.graphics.getHeight() + "]"); manager = new AssetManager(); + factory = new Factory(); skin = new Skin(Gdx.files.internal("skin/uiskin.json")); this.setScreen(new LoadScreen(this)); - } public void loadAssets() @@ -49,6 +51,10 @@ public class TankOnTank extends Game Gdx.app.debug("TankOnTank", "diagnostics:\n" + manager.getDiagnostics() ); } + public void onLoaded() + { + factory.setAtlas(manager.get("data/assets.atlas", TextureAtlas.class)); + } // @Override // public void render () @@ -69,6 +75,7 @@ public class TankOnTank extends Game public void dispose() { Gdx.app.debug("TankOnTank", "dispose()"); + factory.dispose(); getScreen().dispose(); } diff --git a/core/src/ch/asynk/tankontank/screens/LoadScreen.java b/core/src/ch/asynk/tankontank/screens/LoadScreen.java index ac607e9..a9419be 100644 --- a/core/src/ch/asynk/tankontank/screens/LoadScreen.java +++ b/core/src/ch/asynk/tankontank/screens/LoadScreen.java @@ -48,6 +48,7 @@ public class LoadScreen implements Screen delay += delta; if (delay >= 0.2f) { Gdx.app.debug("LoadScreen", "assets loaded : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB"); + game.onLoaded(); game.setScreen(new GameScreen(game)); dispose(); } |