diff --git a/android/assets/badlogic.jpg b/android/assets/badlogic.jpg deleted file mode 100644 index 4390da6..0000000 Binary files a/android/assets/badlogic.jpg and /dev/null differ diff --git a/android/assets/cannon_barrel.png b/android/assets/cannon_barrel.png deleted file mode 100644 index 805c4f1..0000000 Binary files a/android/assets/cannon_barrel.png and /dev/null differ diff --git a/android/assets/cannon_body.png b/android/assets/cannon_body.png deleted file mode 100644 index 559a3bb..0000000 Binary files a/android/assets/cannon_body.png and /dev/null differ diff --git a/android/assets/cannon_bullet.png b/android/assets/cannon_bullet.png deleted file mode 100644 index 93b4296..0000000 Binary files a/android/assets/cannon_bullet.png and /dev/null differ diff --git a/android/assets/cannon_hearth.png b/android/assets/cannon_hearth.png deleted file mode 100644 index 494efd5..0000000 Binary files a/android/assets/cannon_hearth.png and /dev/null differ diff --git a/android/assets/level_background.png b/android/assets/level_background.png deleted file mode 100644 index 062a0f8..0000000 Binary files a/android/assets/level_background.png and /dev/null differ diff --git a/android/assets/spritesheet.agdtexdef b/android/assets/spritesheet.agdtexdef new file mode 100644 index 0000000..ecc1a05 --- /dev/null +++ b/android/assets/spritesheet.agdtexdef @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/assets/spritesheet.png b/android/assets/spritesheet.png new file mode 100644 index 0000000..dcfddc5 Binary files /dev/null and b/android/assets/spritesheet.png differ diff --git a/core/src/de/samdev/cannonshooter/CannonGame.java b/core/src/de/samdev/cannonshooter/CannonGame.java index 2815a91..051f70f 100644 --- a/core/src/de/samdev/cannonshooter/CannonGame.java +++ b/core/src/de/samdev/cannonshooter/CannonGame.java @@ -5,13 +5,18 @@ import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.graphics.g2d.BitmapFont; import de.samdev.absgdx.framework.AgdxGame; +import de.samdev.absgdx.framework.util.exceptions.AgdxTexDefException; import de.samdev.cannonshooter.level.StandardLevel; public class CannonGame extends AgdxGame { @Override public void onCreate() { - Textures.init(); + try { + Textures.init(); + } catch (AgdxTexDefException e) { + throw new RuntimeException(e); + } setLayer(new StandardLevel(this)); diff --git a/core/src/de/samdev/cannonshooter/Textures.java b/core/src/de/samdev/cannonshooter/Textures.java index 31de7f6..82859cb 100644 --- a/core/src/de/samdev/cannonshooter/Textures.java +++ b/core/src/de/samdev/cannonshooter/Textures.java @@ -1,24 +1,35 @@ package de.samdev.cannonshooter; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; -import de.samdev.absgdx.framework.util.TextureHelper; +import de.samdev.absgdx.framework.menu.texdef.AgdxTextureDefinitionLoader; +import de.samdev.absgdx.framework.util.exceptions.AgdtexdefLoadException; +import de.samdev.absgdx.framework.util.exceptions.AgdtexdefParsingException; public final class Textures { - public static Texture texbackground; - public static Texture cannon_body; + public static AgdxTextureDefinitionLoader spritesheet; + + //######################################################################### + + public static TextureRegion level_background; + + public static TextureRegion cannon_body; public static TextureRegion[] cannon_barrel; public static TextureRegion[] cannon_hearth; - public static Texture cannon_bullet; + public static TextureRegion cannon_bullet; - public static void init() { - texbackground = new Texture("level_background.png"); + public static void init() throws AgdtexdefParsingException, AgdtexdefLoadException { + spritesheet = new AgdxTextureDefinitionLoader(Gdx.files.internal("spritesheet.agdtexdef"), new Texture("spritesheet.png")); + spritesheet.parse(); - cannon_body = new Texture("cannon_body.png"); - cannon_barrel = TextureHelper.load1DArray("cannon_barrel.png", 512, 256, 32); - cannon_hearth = TextureHelper.load1DArray("cannon_hearth.png", 256, 256, 64); - cannon_bullet = new Texture("cannon_bullet.png"); + level_background = spritesheet.getSingleTexture("level_background"); + + cannon_body = spritesheet.getSingleTexture("cannon_body"); + cannon_barrel = spritesheet.getTextureArray("cannon_barrel"); + cannon_hearth = spritesheet.getTextureArray("cannon_hearth"); + cannon_bullet = spritesheet.getSingleTexture("cannon_bullet"); } } diff --git a/core/src/de/samdev/cannonshooter/level/StandardLevel.java b/core/src/de/samdev/cannonshooter/level/StandardLevel.java index 8c40b41..488bf80 100644 --- a/core/src/de/samdev/cannonshooter/level/StandardLevel.java +++ b/core/src/de/samdev/cannonshooter/level/StandardLevel.java @@ -32,11 +32,11 @@ public class StandardLevel extends GameLayer { initMap(); - setTimeMultiplier(3); + //setTimeMultiplier(3); } private void initMap() { - addBackground(new RepeatingBackground(Textures.texbackground, 1/32f)); + addBackground(new RepeatingBackground(Textures.level_background, 1/32f)); setMapScaleResolver(new ShowCompleteMapScaleResolver()); addEntity(new Cannon(6, 25, team_player)); diff --git a/data/border_gradient.pdn b/data/border_gradient.pdn new file mode 100644 index 0000000..d4477c7 Binary files /dev/null and b/data/border_gradient.pdn differ diff --git a/data/hud_sketch.pdn b/data/hud_sketch.pdn index da8f86c..b8e0ad7 100644 Binary files a/data/hud_sketch.pdn and b/data/hud_sketch.pdn differ diff --git a/data/spritesheet.pdn b/data/spritesheet.pdn new file mode 100644 index 0000000..5434e2f Binary files /dev/null and b/data/spritesheet.pdn differ diff --git a/lib/absGDX-framework-1.1.jar b/lib/absGDX-framework-1.1.jar index b1aa3cb..a189fa9 100644 Binary files a/lib/absGDX-framework-1.1.jar and b/lib/absGDX-framework-1.1.jar differ