you can draw walls over projectiles -> they will be deleted

master
GammelJAN 5 years ago
parent 40dc8a51d8
commit 3324560023

@ -96,16 +96,25 @@ public class Model {
break; break;
} }
} }
/*
for(Projectile projectile : projectiles){ for(Projectile projectile : projectiles){
if(Intersector.overlapConvexPolygons(tempPolygon,projectile.getPolygon())){ if(Intersector.overlapConvexPolygons(tempPolygon,projectile.getPolygon())){
possible = false; possible = false;
break; break;
} }
} }
*/
if(possible){ if(possible){
leftWallLength -= Vector2.dst(tempStart.x,tempStart.y,x,y); leftWallLength -= Vector2.dst(tempStart.x,tempStart.y,x,y);
walls.add(new TempWall(angle-Math.PI, tempPolygon, WALL_LIFETIME)); TempWall newWall = new TempWall(angle-Math.PI, tempPolygon, WALL_LIFETIME);
for(int i = 0; i < projectiles.size(); i++){
if(Intersector.overlapConvexPolygons(projectiles.get(i).getPolygon(),newWall.getPolygon())){
projectiles.remove(i);
i--;
}
}
walls.add(newWall);
} }
} }
tempPolygon = null; tempPolygon = null;

Loading…
Cancel
Save