more setup stuff

This commit is contained in:
2015-08-29 12:18:10 +02:00
parent bab60d0536
commit 9dc0b6c617
7 changed files with 240 additions and 3 deletions

View File

@@ -1,13 +1,20 @@
package de.samdev.cannonshooter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import de.samdev.absgdx.framework.AgdxGame;
import de.samdev.cannonshooter.level.StandardLevel;
public class CannonGame extends AgdxGame {
@Override
public void onCreate() {
// TODO Auto-generated method stub
Textures.init();
pushLayer(new StandardLevel(this));
setDebugFont(new BitmapFont(Gdx.files.internal("consolefont.fnt")));
}
@Override

View File

@@ -1,6 +1,11 @@
package de.samdev.cannonshooter;
import com.badlogic.gdx.graphics.Texture;
public final class Textures {
public static Texture texbackground;
public static void init() {
texbackground = new Texture("level_background.png");
}
}

View File

@@ -0,0 +1,23 @@
package de.samdev.cannonshooter.level;
import de.samdev.absgdx.framework.AgdxGame;
import de.samdev.absgdx.framework.layer.GameLayer;
import de.samdev.absgdx.framework.map.TileMap;
import de.samdev.absgdx.framework.map.background.RepeatingBackground;
import de.samdev.cannonshooter.Textures;
public class StandardLevel extends GameLayer {
public StandardLevel(AgdxGame owner) {
super(owner, TileMap.createEmptyMap(32, 20));
addBackground(new RepeatingBackground(Textures.texbackground, 32));
}
@Override
public void onUpdate(float arg0) {
// TODO Auto-generated method stub
}
}