Screens kommen jetzt in der korrekten Reihenfolge beim Spielen.

This commit is contained in:
Jan Philipp Timme 2014-12-09 15:30:40 +01:00
parent 6568fdd46a
commit 571d990f91
5 changed files with 10 additions and 8 deletions

View File

@ -94,10 +94,11 @@ public class GameScreen extends Screen {
if (this.level.isGameOver()) {
if(this.level.playerHasWon()) {
if(PlayerSession.getNextLevel() == null) {
System.out.println("You beat the game! TODO: Transition to HighscoreScreen now!");
this.parent.setOverlay(new HighscoreScreen(this.parent));
} else {
//Go to the I don't know yet Screen if the game is over and the player WON.
this.parent.setOverlay(new GameWonScreen(this.parent));
}
//Go to the I don't know yet Screen if the game is over and the player WON.
this.parent.setOverlay(new GameWonScreen(this.parent));
} else {
//Go to GameOverScreen if the game is over - the player died and lost the game.
this.parent.setOverlay(new GameOverScreen(this.parent));

View File

@ -48,7 +48,7 @@ public class GameWonScreen extends Screen {
g.drawString("You win!", GameConfig.windowWidth/2-210, 200);
g.setFont(new Font("Monospace", 0, 20));
g.setColor(new Color(0, 0, 0));
g.drawString("Forwards Ever!", GameConfig.windowWidth/2-70, 332);
g.drawString("Weiter", GameConfig.windowWidth/2-70, 332);
g.drawString("Hauptmen\u00fc", GameConfig.windowWidth/2-60, 432);
}
@ -88,7 +88,7 @@ public class GameWonScreen extends Screen {
} else if(this.animationStatus == 2) {
switch (this.menuPoint) {
case 0:
this.parent.setOverlay(new GameScreen(this.parent));
this.parent.setOverlay(new ShopScreen(this.parent));
break;
case 1:
this.parent.setOverlay(new MainMenuScreen(this.parent));

View File

@ -12,6 +12,7 @@ import java.util.ArrayList;
import java.util.Scanner;
import de.teamteamteam.spacescooter.brain.GameConfig;
import de.teamteamteam.spacescooter.brain.PlayerSession;
import de.teamteamteam.spacescooter.control.Keyboard;
import de.teamteamteam.spacescooter.entity.Player;
import de.teamteamteam.spacescooter.gui.Button;
@ -62,6 +63,7 @@ public class HighscoreScreen extends Screen{
this.playerMoveSpeed += 0.1;
} else this.animationStatus = 2;
} else if(this.animationStatus == 2) {
PlayerSession.reset(); //The player now entered his highscore, reset the PlayerSession now.
this.parent.setOverlay(new MainMenuScreen(this.parent));
}
}

View File

@ -74,7 +74,6 @@ public class LoadingScreen extends Screen {
g.fillRect(0, 0, GameConfig.windowWidth, GameConfig.windowHeight);
g.setColor(Color.WHITE);
g.setFont(new Font("Monospace", 0, 50));
g.drawString("Loading ...", 100, 100);
g.drawString("Progress: " + this.getProgress() + "%", 200, 500);
}

View File

@ -65,7 +65,7 @@ public class ShopScreen extends Screen {
g.drawString("Rocket", GameConfig.windowWidth / 2 - 110, 390);
g.drawString("Beam", GameConfig.windowWidth / 2 + 45, 390);
g.setColor(new Color(0, 0, 0));
g.drawString("Hauptmen\u00fc", GameConfig.windowWidth/2-55, 533);
g.drawString("Weiter", GameConfig.windowWidth/2-55, 533);
}
@Override
@ -154,7 +154,7 @@ public class ShopScreen extends Screen {
this.playerMoveSpeed += 0.1;
} else this.animationStatus = 2;
} else if(this.animationStatus == 2) {
this.parent.setOverlay(new MainMenuScreen(this.parent));
this.parent.setOverlay(new GameScreen(this.parent));
}
}