|
|
|
|
@ -19,6 +19,9 @@ import model.Level;
|
|
|
|
|
import model.Projectile;
|
|
|
|
|
import view.Gamescreen;
|
|
|
|
|
import view.Levelscreen;
|
|
|
|
|
|
|
|
|
|
import com.badlogic.gdx.math.Intersector;
|
|
|
|
|
import com.badlogic.gdx.math.Rectangle;
|
|
|
|
|
import com.badlogic.gdx.utils.Timer;
|
|
|
|
|
import com.badlogic.gdx.utils.viewport.ExtendViewport;
|
|
|
|
|
import com.badlogic.gdx.utils.viewport.FitViewport;
|
|
|
|
|
@ -85,12 +88,21 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
|
gs = null;
|
|
|
|
|
ws = new Winscreen(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
gs.step(level);
|
|
|
|
|
level.step();
|
|
|
|
|
gs.step(level);
|
|
|
|
|
for(Rectangle rect : gs.getGoalRects()){
|
|
|
|
|
if(Intersector.overlaps(gs.getProjectileCirc(), rect)){
|
|
|
|
|
if(rect.getHeight() == 1){
|
|
|
|
|
level.horizontalCollision();
|
|
|
|
|
}
|
|
|
|
|
else if(rect.getWidth() == 1){
|
|
|
|
|
level.verticalCollision();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|