game wird neugestartet, nachdem man gestorben ist
parent
8f5ebb93b1
commit
07a7b02819
|
@ -1,14 +0,0 @@
|
|||
/BigPoint.class
|
||||
/Brick.class
|
||||
/Game.class
|
||||
/Ghost.class
|
||||
/Hintergrund.class
|
||||
/Lives.class
|
||||
/Main.class
|
||||
/Map.class
|
||||
/MapMenu$1.class
|
||||
/MapMenu.class
|
||||
/Picture.class
|
||||
/Player.class
|
||||
/Point.class
|
||||
/Portal.class
|
Binary file not shown.
BIN
bin/Brick.class
BIN
bin/Brick.class
Binary file not shown.
BIN
bin/Game.class
BIN
bin/Game.class
Binary file not shown.
BIN
bin/Ghost.class
BIN
bin/Ghost.class
Binary file not shown.
Binary file not shown.
BIN
bin/Lives.class
BIN
bin/Lives.class
Binary file not shown.
BIN
bin/Main.class
BIN
bin/Main.class
Binary file not shown.
BIN
bin/Map.class
BIN
bin/Map.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/Player.class
BIN
bin/Player.class
Binary file not shown.
BIN
bin/Point.class
BIN
bin/Point.class
Binary file not shown.
BIN
bin/Portal.class
BIN
bin/Portal.class
Binary file not shown.
|
@ -145,7 +145,7 @@ public class Game {
|
|||
delay(1000);
|
||||
frame.setVisible(true);
|
||||
|
||||
while (true) { // Main-Loop
|
||||
while (player.lives > 0) { // Main-Loop
|
||||
|
||||
dt = System.nanoTime() - lastT; // delta time
|
||||
lastT = System.nanoTime(); // delta time
|
||||
|
@ -403,7 +403,8 @@ public class Game {
|
|||
liveLabels[player.lives].setBounds(0, 0, 0, 0); // Das herz wird "entfernt"
|
||||
|
||||
if (player.lives == 0) { // Wenn der Spieler keine Leben mehr übrig hat
|
||||
System.exit(0); // Das Programm wird beendet
|
||||
fpsLabel.setText("YOU LOST");
|
||||
delay(3000);
|
||||
}
|
||||
|
||||
delay(200); // Damit nicht sofort wieder alle losgeht
|
||||
|
@ -444,7 +445,6 @@ public class Game {
|
|||
if (empty) {
|
||||
fpsLabel.setText("YOU WON");
|
||||
delay(5000);
|
||||
System.exit(0); // Das Programm wird beendet
|
||||
// HIER DEN HIGHSCORE IMPLEMENTIEREN
|
||||
}
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ public class Game {
|
|||
}
|
||||
|
||||
// Methode zum verzögern (warten) in ms
|
||||
public void delay(int time) {
|
||||
private void delay(int time) {
|
||||
|
||||
try {
|
||||
Thread.sleep(time);
|
||||
|
|
|
@ -3,29 +3,49 @@
|
|||
// Muss ausgeführt werden zum Starten
|
||||
|
||||
public class Main {
|
||||
|
||||
static
|
||||
|
||||
@SuppressWarnings("unused") // Die "unused" - Warnungen werden in dieser Datei nicht mehr angezeigt
|
||||
MapMenu menu;
|
||||
|
||||
static Game game;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.setProperty("sun.java2d.opengl", "true");
|
||||
|
||||
MapMenu menu = new MapMenu();
|
||||
|
||||
while(!menu.rdy) {
|
||||
delay(1);
|
||||
menu = new MapMenu();
|
||||
|
||||
while (!menu.rdy) {
|
||||
delay(100);
|
||||
}
|
||||
|
||||
Game game = new Game(menu.selectedMap + ".txt");
|
||||
|
||||
}
|
||||
|
||||
// Methode zum verzögern (warten) in ms
|
||||
public static void delay(int time) {
|
||||
try {
|
||||
Thread.sleep(time);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
game = new Game(menu.selectedMap + ".txt");
|
||||
|
||||
while (true) {
|
||||
|
||||
game.frame.dispose();
|
||||
|
||||
menu = null;
|
||||
game = null;
|
||||
|
||||
menu = new MapMenu();
|
||||
|
||||
while (!menu.rdy) {
|
||||
delay(100);
|
||||
}
|
||||
|
||||
game = new Game(menu.selectedMap + ".txt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Methode zum verzögern (warten) in ms
|
||||
public static void delay(int time) {
|
||||
try {
|
||||
Thread.sleep(time);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue