more setup stuff
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
23
core/src/de/samdev/cannonshooter/level/StandardLevel.java
Normal file
23
core/src/de/samdev/cannonshooter/level/StandardLevel.java
Normal 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
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user