diff --git a/android/assets/levels/plevel002.tmx b/android/assets/levels/plevel002.tmx
index 38fa785..a84af92 100644
--- a/android/assets/levels/plevel002.tmx
+++ b/android/assets/levels/plevel002.tmx
@@ -3521,9 +3521,9 @@
-
-
-
+
+
+
@@ -4021,9 +4021,9 @@
+
-
-
+
@@ -4523,7 +4523,7 @@
-
+
@@ -5023,7 +5023,7 @@
-
+
@@ -5523,7 +5523,7 @@
-
+
@@ -6023,7 +6023,7 @@
-
+
@@ -6523,7 +6523,7 @@
-
+
@@ -7023,7 +7023,7 @@
-
+
@@ -7523,7 +7523,7 @@
-
+
@@ -8023,7 +8023,7 @@
-
+
@@ -8521,9 +8521,9 @@
+
-
-
+
@@ -9021,9 +9021,9 @@
+
-
-
+
@@ -14026,7 +14026,7 @@
-
+
@@ -19026,7 +19026,7 @@
-
+
diff --git a/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java b/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java
index 90fcab6..e408c9a 100644
--- a/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java
+++ b/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java
@@ -100,6 +100,11 @@ public class CRGameRenderer extends AbstractGameRenderer {
}
}
+ //int px = (int)((gameworld.player.bounds.x + gameworld.player.bounds.width / 2f) / FloorTileEntity.FLOORTILE_WIDTH);
+ //int py = (int)((gameworld.player.bounds.y + gameworld.player.bounds.height / 2f) / FloorTileEntity.FLOORTILE_HEIGHT);
+ //shapeRenderer.setColor(0, 0, 1, 1f);
+ //shapeRenderer.rect(px * FloorTileEntity.FLOORTILE_WIDTH, py * FloorTileEntity.FLOORTILE_HEIGHT, FloorTileEntity.FLOORTILE_WIDTH, FloorTileEntity.FLOORTILE_HEIGHT);
+
shapeRenderer.end();
}
@@ -150,7 +155,7 @@ public class CRGameRenderer extends AbstractGameRenderer {
renderDebug("Level Progress: " + ((StaticMapProvider)gameworld.mapprovider).mapPlayerPos + "/" + ((StaticMapProvider)gameworld.mapprovider).mapMaxWidth);
renderDebug("Player(tile): [" + (int)(gameworld.player.bounds.x / FloorTileEntity.FLOORTILE_WIDTH) + "|" + (int)(gameworld.player.bounds.y / FloorTileEntity.FLOORTILE_WIDTH) + "]");
- renderDebug("Player(trigger): " + gameworld.mapprovider.getTrigger((int)(gameworld.player.bounds.x / FloorTileEntity.FLOORTILE_WIDTH), (int)(gameworld.player.bounds.y / FloorTileEntity.FLOORTILE_WIDTH)));
+ renderDebug("Player(trigger): " + gameworld.player.getTrigger());
renderDebug("Player(velo): [" + gameworld.player.velocity.x + " | " + gameworld.player.velocity.y + "]");
endDebug();
diff --git a/core/src/de/samdev/colorrunner/game/world/entities/CRGameEntity.java b/core/src/de/samdev/colorrunner/game/world/entities/CRGameEntity.java
index 9b5f1d0..bcbcc79 100644
--- a/core/src/de/samdev/colorrunner/game/world/entities/CRGameEntity.java
+++ b/core/src/de/samdev/colorrunner/game/world/entities/CRGameEntity.java
@@ -5,6 +5,8 @@ import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import de.samdev.colorrunner.game.world.CRGameWorld;
+import de.samdev.colorrunner.game.world.entities.gameentities.floor.FloorTileEntity;
+import de.samdev.colorrunner.game.world.map.provider.TriggerType;
public abstract class CRGameEntity {
@@ -43,4 +45,8 @@ public abstract class CRGameEntity {
public abstract Texture getTexture();
public abstract boolean canCollide(boolean actualCollision, CRGameEntity collider);
+
+ public TriggerType getTrigger() {
+ return world.mapprovider.getTrigger((int)((bounds.x + bounds.width/2f) / FloorTileEntity.FLOORTILE_WIDTH), (int)((bounds.y + bounds.height/2f) / FloorTileEntity.FLOORTILE_HEIGHT));
+ }
}
diff --git a/core/src/de/samdev/colorrunner/game/world/entities/gameentities/PlayerEntity.java b/core/src/de/samdev/colorrunner/game/world/entities/gameentities/PlayerEntity.java
index ed09e3c..1ad81d0 100644
--- a/core/src/de/samdev/colorrunner/game/world/entities/gameentities/PlayerEntity.java
+++ b/core/src/de/samdev/colorrunner/game/world/entities/gameentities/PlayerEntity.java
@@ -41,7 +41,7 @@ public class PlayerEntity extends MovingEntity {
updateRotation(delta);
- TriggerType trigger = world.mapprovider.getTrigger((int)((bounds.x + bounds.width/2f) / FloorTileEntity.FLOORTILE_WIDTH), (int)((bounds.y + bounds.height/2f) / FloorTileEntity.FLOORTILE_HEIGHT));
+ TriggerType trigger = getTrigger();
switch (trigger){
case RUNTOP:
if (controller.getControllerType() != ControllingType.RUNTOP) controller = new RunTopPlayerController(this);