diff --git a/core/src/com/trs/game/Controller.java b/core/src/com/trs/game/Controller.java index 6034cc8..c26d339 100644 --- a/core/src/com/trs/game/Controller.java +++ b/core/src/com/trs/game/Controller.java @@ -217,6 +217,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor { screen = new MainMenuScreen(GAME_WORLD_WIDTH,GAME_WORLD_HEIGHT); break; case 1: //GOTO GAMESCREEN + model = new Model(); screen = new GameScreen(GAME_WORLD_WIDTH,GAME_WORLD_HEIGHT); break; case 2: //GOTO ENDSCREEN diff --git a/core/src/com/trs/game/model/Model.java b/core/src/com/trs/game/model/Model.java index 884bebd..e4ef8dd 100644 --- a/core/src/com/trs/game/model/Model.java +++ b/core/src/com/trs/game/model/Model.java @@ -62,6 +62,12 @@ public class Model { break; } } + for(Projectile projectile : projectiles){ + if(Intersector.overlapConvexPolygons(tempPolygon,projectile.getPolygon())){ + possible = false; + break; + } + } if(possible){ leftWallLength -= Vector2.dst(tempStart.x,tempStart.y,x,y);