wall can't overdraw projectile

master
GammelJAN 5 years ago
parent 9c9439240b
commit 8dfd9a445a

@ -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

@ -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);

Loading…
Cancel
Save