diff --git a/android/assets/map_pieces/p14.tmx b/android/assets/map_pieces/p14.tmx
new file mode 100644
index 0000000..4c4d997
--- /dev/null
+++ b/android/assets/map_pieces/p14.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p15.tmx b/android/assets/map_pieces/p15.tmx
new file mode 100644
index 0000000..e8940f3
--- /dev/null
+++ b/android/assets/map_pieces/p15.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p16.tmx b/android/assets/map_pieces/p16.tmx
new file mode 100644
index 0000000..bae0802
--- /dev/null
+++ b/android/assets/map_pieces/p16.tmx
@@ -0,0 +1,1288 @@
+
+
diff --git a/android/assets/map_pieces/p17.tmx b/android/assets/map_pieces/p17.tmx
new file mode 100644
index 0000000..c6cd875
--- /dev/null
+++ b/android/assets/map_pieces/p17.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p18.tmx b/android/assets/map_pieces/p18.tmx
new file mode 100644
index 0000000..55910e7
--- /dev/null
+++ b/android/assets/map_pieces/p18.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p19.tmx b/android/assets/map_pieces/p19.tmx
new file mode 100644
index 0000000..9aa67c1
--- /dev/null
+++ b/android/assets/map_pieces/p19.tmx
@@ -0,0 +1,968 @@
+
+
diff --git a/android/assets/map_pieces/p20.tmx b/android/assets/map_pieces/p20.tmx
new file mode 100644
index 0000000..6bb22ab
--- /dev/null
+++ b/android/assets/map_pieces/p20.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p21.tmx b/android/assets/map_pieces/p21.tmx
new file mode 100644
index 0000000..c866ac4
--- /dev/null
+++ b/android/assets/map_pieces/p21.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p22.tmx b/android/assets/map_pieces/p22.tmx
new file mode 100644
index 0000000..3e79b34
--- /dev/null
+++ b/android/assets/map_pieces/p22.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p23.tmx b/android/assets/map_pieces/p23.tmx
new file mode 100644
index 0000000..afdc149
--- /dev/null
+++ b/android/assets/map_pieces/p23.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p24.tmx b/android/assets/map_pieces/p24.tmx
new file mode 100644
index 0000000..b606096
--- /dev/null
+++ b/android/assets/map_pieces/p24.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p25.tmx b/android/assets/map_pieces/p25.tmx
new file mode 100644
index 0000000..cdcaf35
--- /dev/null
+++ b/android/assets/map_pieces/p25.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/android/assets/map_pieces/p26.tmx b/android/assets/map_pieces/p26.tmx
new file mode 100644
index 0000000..eb9d37b
--- /dev/null
+++ b/android/assets/map_pieces/p26.tmx
@@ -0,0 +1,648 @@
+
+
diff --git a/core/src/de/samdev/colorrunner/CRGame.java b/core/src/de/samdev/colorrunner/CRGame.java
index 41b7cc5..37793e9 100644
--- a/core/src/de/samdev/colorrunner/CRGame.java
+++ b/core/src/de/samdev/colorrunner/CRGame.java
@@ -2,19 +2,17 @@ package de.samdev.colorrunner;
import com.badlogic.gdx.Game;
+import de.samdev.colorrunner.screens.gameScreen.GameScreen;
import de.samdev.colorrunner.screens.menu.SplashScreen;
public class CRGame extends Game {
public final static boolean DEBUG = true;
- private SplashScreen SplashScreen;
-
@Override
public void create() {
- SplashScreen = new SplashScreen();
-
- //----------------------------------
-
- setScreen(SplashScreen);
+ if (DEBUG)
+ setScreen(new GameScreen());
+ else
+ setScreen(new SplashScreen());
}
}
diff --git a/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java b/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java
index 823bcc6..6d08ab1 100644
--- a/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java
+++ b/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java
@@ -80,6 +80,7 @@ public class CRGameRenderer extends AbstractGameRenderer {
renderDebug("ExecTime: " + (int)(avgExecTime*100) / 100.0+ " / " + (int)(10000/gameworld.fps.getFPS())/10.0 + "ms (" + (int)((avgExecTime/(1000/gameworld.fps.getFPS()))*1000) / 10.0 + "%)");
renderDebug("CameraOffset: (" + (int)cam.position.x + "|" + (int)cam.position.y + ")");
renderDebug("Player(x): " + (int)gameworld.player.bounds.x);
+ renderDebug("Procedural Piece: \"" + gameworld.getCurrentSection().piece_name + "\"");
endDebug();
}
}
diff --git a/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java b/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java
index c11ba13..478fab7 100644
--- a/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java
+++ b/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java
@@ -18,12 +18,14 @@ import de.samdev.colorrunner.game.world.entities.gameentities.floor.RightStateFl
import de.samdev.colorrunner.game.world.entities.gameentities.floor.UpStateFloorTileEntity;
import de.samdev.colorrunner.game.world.map.CRMapStorage;
import de.samdev.colorrunner.game.world.map.CRTiledMap;
+import de.samdev.colorrunner.game.world.map.MapSection;
import de.samdev.colorrunner.input.GameInputListener;
public class CRGameWorld implements GameInputListener {
public PlayerEntity player;
public List entities = new ArrayList();
+ public List sections = new ArrayList();
public FPSCounter fps = new FPSCounter();
@@ -103,9 +105,20 @@ public class CRGameWorld implements GameInputListener {
}
}
+ sections.add(new MapSection(pos.x, width * FloorTileEntity.FLOORTILE_WIDTH, map.name));
+
return width * FloorTileEntity.FLOORTILE_WIDTH;
}
+ public MapSection getCurrentSection() {
+ for (MapSection sec : sections) {
+ if (sec.start <= player.bounds.x && sec.end >= player.bounds.x)
+ return sec;
+ }
+
+ return new MapSection(0, 0, "NULL");
+ }
+
@Override
public void doJump() {
player.jump();
diff --git a/core/src/de/samdev/colorrunner/game/world/map/CRMapStorage.java b/core/src/de/samdev/colorrunner/game/world/map/CRMapStorage.java
index b519a14..1e246ab 100644
--- a/core/src/de/samdev/colorrunner/game/world/map/CRMapStorage.java
+++ b/core/src/de/samdev/colorrunner/game/world/map/CRMapStorage.java
@@ -25,13 +25,26 @@ public class CRMapStorage {
public static final CRTiledMap map_11 = register("p11.tmx");
public static final CRTiledMap map_12 = register("p12.tmx");
public static final CRTiledMap map_13 = register("p13.tmx");
+ public static final CRTiledMap map_14 = register("p14.tmx");
+ public static final CRTiledMap map_15 = register("p15.tmx");
+ public static final CRTiledMap map_16 = register("p16.tmx");
+ public static final CRTiledMap map_17 = register("p17.tmx");
+ public static final CRTiledMap map_18 = register("p18.tmx");
+ public static final CRTiledMap map_19 = register("p19.tmx");
+ public static final CRTiledMap map_20 = register("p20.tmx");
+ public static final CRTiledMap map_21 = register("p21.tmx");
+ public static final CRTiledMap map_22 = register("p22.tmx");
+ public static final CRTiledMap map_23 = register("p23.tmx");
+ public static final CRTiledMap map_24 = register("p24.tmx");
+ public static final CRTiledMap map_25 = register("p25.tmx");
+ public static final CRTiledMap map_26 = register("p26.tmx");
public static CRTiledMap register(String path) {
return register(path, true);
}
public static CRTiledMap register(String path, boolean doRegister) {
- CRTiledMap m = CRTiledMap.load(Gdx.files.internal("map_pieces/" + path).readString());
+ CRTiledMap m = CRTiledMap.load(path, Gdx.files.internal("map_pieces/" + path).readString());
if (doRegister)
maps.add(m);
diff --git a/core/src/de/samdev/colorrunner/game/world/map/CRTiledMap.java b/core/src/de/samdev/colorrunner/game/world/map/CRTiledMap.java
index 9752614..fd07e3b 100644
--- a/core/src/de/samdev/colorrunner/game/world/map/CRTiledMap.java
+++ b/core/src/de/samdev/colorrunner/game/world/map/CRTiledMap.java
@@ -18,8 +18,9 @@ public class CRTiledMap {
public int height;
public int[][] map;
+ public String name;
- public static CRTiledMap load(String inputXmlString) {
+ public static CRTiledMap load(String name, String inputXmlString) {
CRTiledMap result = new CRTiledMap();
XmlReader reader = new XmlReader();
@@ -35,6 +36,7 @@ public class CRTiledMap {
result.map = new int[width][height];
result.width = width;
result.height = height;
+ result.name = name;
for (int i = 0; i < tiles.size; i++) {
result.map[i % width][i / width] = tiles.get(i).getInt("gid");
diff --git a/core/src/de/samdev/colorrunner/game/world/map/MapSection.java b/core/src/de/samdev/colorrunner/game/world/map/MapSection.java
new file mode 100644
index 0000000..869cf10
--- /dev/null
+++ b/core/src/de/samdev/colorrunner/game/world/map/MapSection.java
@@ -0,0 +1,14 @@
+package de.samdev.colorrunner.game.world.map;
+
+public class MapSection {
+ public float start;
+ public float end;
+
+ public String piece_name;
+
+ public MapSection(float x, float width, String name) {
+ start = x;
+ end = x + width;
+ piece_name = name;
+ }
+}