From af85292707988cd33212bae1ecf35b7978dbe458 Mon Sep 17 00:00:00 2001 From: toksikk Date: Tue, 11 Nov 2014 13:13:52 +0100 Subject: [PATCH] CollisionHandler Anpassung --- .../de/heatup/mapengine/CollisionHandler.java | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/HeatUp/src/de/heatup/mapengine/CollisionHandler.java b/HeatUp/src/de/heatup/mapengine/CollisionHandler.java index 08a626c..6132a7f 100644 --- a/HeatUp/src/de/heatup/mapengine/CollisionHandler.java +++ b/HeatUp/src/de/heatup/mapengine/CollisionHandler.java @@ -15,13 +15,14 @@ public class CollisionHandler { * @return */ public static boolean checkCollision(Player movingObject, char d) { -// if (movingObject == (movingObjects.get(0))) { - if (movingObject.equals(movingObjects.get(0))) { - enemyCollision(movingObject, d); + if (movingObject == (movingObjects.get(0))) { +// return normalCheck(movingObject, d); +// if (movingObject.equals(movingObjects.get(0))) { +// enemyCollision(movingObject, d); hardwareCollision(movingObject, d); return normalCheck(movingObject, d); } else { - playerCollision(movingObject, d); +// playerCollision(movingObject, d); return normalCheck(movingObject, d); } // switch (d) { @@ -50,14 +51,23 @@ public class CollisionHandler { // } } private static void playerCollision(Player movingObject, char d) { - if (movingObject.getGridLocation().x== movingObjects.get(0).getGridLocation().x && movingObject.getGridLocation().y == movingObjects.get(0).getGridLocation().y) { -// System.exit(-1); - } +// if (movingObject.getGridLocation().x== movingObjects.get(0).getGridLocation().x && movingObject.getGridLocation().y == movingObjects.get(0).getGridLocation().y) { +//// System.exit(-1); +// } } private static void enemyCollision(Player movingObject, char d ) { +// for (int i=1; i