|
|
|
@ -46,6 +46,8 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
boolean isColliding;
|
|
|
|
boolean isColliding;
|
|
|
|
Level[] level;
|
|
|
|
Level[] level;
|
|
|
|
int currentLevel;
|
|
|
|
int currentLevel;
|
|
|
|
|
|
|
|
int beatenLevel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OrthographicCamera camera;
|
|
|
|
OrthographicCamera camera;
|
|
|
|
Viewport viewport;
|
|
|
|
Viewport viewport;
|
|
|
|
@ -154,6 +156,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
gs.dispose();
|
|
|
|
gs.dispose();
|
|
|
|
stepTimer.stop();
|
|
|
|
stepTimer.stop();
|
|
|
|
level[currentLevel].reset();
|
|
|
|
level[currentLevel].reset();
|
|
|
|
|
|
|
|
beatenLevel++;
|
|
|
|
gs = null;
|
|
|
|
gs = null;
|
|
|
|
ws = new Winscreen(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, true, currentLevel);
|
|
|
|
ws = new Winscreen(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, true, currentLevel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -188,14 +191,14 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
if(ts != null){
|
|
|
|
if(ts != null){
|
|
|
|
ts.dispose();
|
|
|
|
ts.dispose();
|
|
|
|
ts = null;
|
|
|
|
ts = null;
|
|
|
|
ls = new Levelscreen(levelAmount, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT);
|
|
|
|
ls = new Levelscreen(beatenLevel, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(ls != null){
|
|
|
|
else if(ls != null){
|
|
|
|
if(x < Gdx.graphics.getWidth() * 0.15){
|
|
|
|
if(x < Gdx.graphics.getWidth() * 0.15){
|
|
|
|
if(ls.getSelectedLevel() > 0)ls.setSelectedLevel(ls.getSelectedLevel()-1);
|
|
|
|
if(ls.getSelectedLevel() > 0)ls.setSelectedLevel(ls.getSelectedLevel()-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(x > Gdx.graphics.getWidth() * 0.85){
|
|
|
|
else if(x > Gdx.graphics.getWidth() * 0.85){
|
|
|
|
if(ls.getSelectedLevel() < levelAmount)
|
|
|
|
if(ls.getSelectedLevel() < beatenLevel)
|
|
|
|
ls.setSelectedLevel(ls.getSelectedLevel()+1);
|
|
|
|
ls.setSelectedLevel(ls.getSelectedLevel()+1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
@ -212,7 +215,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(ws != null){
|
|
|
|
else if(ws != null){
|
|
|
|
if(x < Gdx.graphics.getWidth() * 0.33){
|
|
|
|
if(x < Gdx.graphics.getWidth() * 0.33){
|
|
|
|
ls = new Levelscreen(levelAmount, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT);
|
|
|
|
ls = new Levelscreen(beatenLevel, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT);
|
|
|
|
ws = null;
|
|
|
|
ws = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(x < Gdx.graphics.getWidth() * 0.66){
|
|
|
|
else if(x < Gdx.graphics.getWidth() * 0.66){
|
|
|
|
@ -220,7 +223,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
|
|
|
|
stepTimer.start();
|
|
|
|
stepTimer.start();
|
|
|
|
ws = null;
|
|
|
|
ws = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(currentLevel < levelAmount){
|
|
|
|
else if(currentLevel < levelAmount && ws.getWin()){
|
|
|
|
currentLevel++;
|
|
|
|
currentLevel++;
|
|
|
|
gs = new Gamescreen(level[currentLevel], GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera.combined);
|
|
|
|
gs = new Gamescreen(level[currentLevel], GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera.combined);
|
|
|
|
stepTimer.start();
|
|
|
|
stepTimer.start();
|
|
|
|
|