Remove menu from GameWonScreen, this is one way only.
This commit is contained in:
parent
56109f2774
commit
fbd83aa34e
|
@ -5,5 +5,4 @@
|
|||
bin
|
||||
compiled
|
||||
game.jar
|
||||
|
||||
./Highscore
|
||||
Highscore
|
||||
|
|
20
save
20
save
|
@ -1,20 +0,0 @@
|
|||
200 Name
|
||||
190 Name
|
||||
180 Name
|
||||
170 Name
|
||||
160 Name
|
||||
150 Name
|
||||
140 Name
|
||||
130 Name
|
||||
120 Name
|
||||
110 Name
|
||||
100 Name
|
||||
90 Name
|
||||
80 Name
|
||||
70 Name
|
||||
60 Name
|
||||
50 Name
|
||||
40 Name
|
||||
30 Name
|
||||
20 Name
|
||||
10 Name
|
|
@ -23,14 +23,12 @@ public class GameWonScreen extends Screen {
|
|||
private float playerMoveSpeed = 0;
|
||||
private int colorValue = 0;
|
||||
private boolean colorValueIncrease = true;
|
||||
private int menuPoint = 0;
|
||||
private int animationStatus = 0; //0 = Noch nicht gestartet, 1 = Animation läuft, 2 = Animation beendet
|
||||
|
||||
public GameWonScreen(Screen parent) {
|
||||
super(parent);
|
||||
this.img = Loader.getBufferedImageByFilename("images/pausebackground.png");
|
||||
new Button(GameConfig.windowWidth/2-125, 300);
|
||||
new Button(GameConfig.windowWidth/2-125, 400);
|
||||
player = new Player(GameConfig.windowWidth/2-170, 309);
|
||||
player.setCanMove(false);
|
||||
player.setCanShoot(false);
|
||||
|
@ -66,15 +64,6 @@ public class GameWonScreen extends Screen {
|
|||
if(this.colorValue < -70) this.colorValueIncrease = true;
|
||||
}
|
||||
|
||||
if(Keyboard.isKeyDown(KeyEvent.VK_DOWN) && this.animationStatus == 0){
|
||||
this.menuPoint = 1;
|
||||
player.setPosition(player.getX(), 409);
|
||||
}
|
||||
if(Keyboard.isKeyDown(KeyEvent.VK_UP) && this.animationStatus == 0){
|
||||
this.menuPoint = 0;
|
||||
player.setPosition(player.getX(), 309);
|
||||
}
|
||||
|
||||
// make a selection
|
||||
if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) || Keyboard.isKeyDown(KeyEvent.VK_SPACE)) {
|
||||
this.animationStatus = 1;
|
||||
|
@ -83,13 +72,11 @@ public class GameWonScreen extends Screen {
|
|||
if(player.getX() <= GameConfig.windowWidth) {
|
||||
player.setPosition(player.getX() + (int) playerMoveSpeed, player.getY());
|
||||
playerMoveSpeed += 0.1;
|
||||
} else this.animationStatus = 2;
|
||||
} else if(this.animationStatus == 2) {
|
||||
switch (this.menuPoint) {
|
||||
case 0:
|
||||
this.parent.setOverlay(new ShopScreen(this.parent));
|
||||
break;
|
||||
} else {
|
||||
this.animationStatus = 2;
|
||||
}
|
||||
} else if(this.animationStatus == 2) {
|
||||
this.parent.setOverlay(new ShopScreen(this.parent));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue