From 359ed979ce748aea1d7fed7c7ddc2d62aa7abae8 Mon Sep 17 00:00:00 2001 From: Armin Benz Date: Sun, 30 Apr 2017 19:58:06 +0200 Subject: [PATCH] Ravioli, Ravioli give me the collisioni --- .../colorrunner/game/world/entities/MovingEntity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/de/samdev/colorrunner/game/world/entities/MovingEntity.java b/core/src/de/samdev/colorrunner/game/world/entities/MovingEntity.java index 3051ad9..bc8e7f5 100644 --- a/core/src/de/samdev/colorrunner/game/world/entities/MovingEntity.java +++ b/core/src/de/samdev/colorrunner/game/world/entities/MovingEntity.java @@ -67,6 +67,8 @@ public abstract class MovingEntity extends CRGameEntity { } } + if (getFirstCollision() != null) return true; // collision but movement AND correction failed + bounds.x = next.x; return collided; } @@ -112,6 +114,8 @@ public abstract class MovingEntity extends CRGameEntity { } } + if (getFirstCollision() != null) return true; // collision but movement AND correction failed + bounds.y = next.y; return collided; } @@ -150,7 +154,7 @@ public abstract class MovingEntity extends CRGameEntity { if (ent2 == this) continue; if (overlaps(next, ent2.bounds) && ent2.canCollide(false, this)) { - Gdx.app.log("Entity Hitbox", "Expand failed X- || WTF"); + Gdx.app.log("Entity Hitbox", "Expand failed X-"); return false; } } @@ -223,7 +227,7 @@ public abstract class MovingEntity extends CRGameEntity { if (ent2 == this) continue; if (overlaps(next, ent2.bounds) && ent2.canCollide(false, this)) { - Gdx.app.log("Entity Hitbox", "Expand failed Y- || WTF"); + Gdx.app.log("Entity Hitbox", "Expand failed Y-"); return false; } }