Skip to content
Snippets Groups Projects
Commit 3c6fbc0b authored by David's avatar David
Browse files

comment code and changed background picture

parent 63656ae0
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ public class SaveManager {
public static String username;
// function die gespeicherten daten zu loaden
public static void load() throws IOException {
FileReader fileReader = new FileReader("src/main/java/org/example/io/saves.csv");
BufferedReader bufferedReader = new BufferedReader(fileReader);
......@@ -32,7 +33,7 @@ public class SaveManager {
System.out.println("");
}
// schreibt score und username in saves.csv
public static void persist() throws IOException {
FileWriter fileWriter = new FileWriter("src/main/java/org/example/io/saves.csv");
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
......
dave;29
bobby;423
testname;31
Enter your name;28
samy;34
username;27
......@@ -90,8 +90,8 @@ public class SnakeGameController implements Initializable {
anchorPane.getChildren().clear();
anchorPane.getChildren().add(score);
score.setText("Game Over "+ SaveManager.username + " your score " +snake.getLength());
score.setText("Game Over "+ SaveManager.username + " you're score is:" +snake.getLength());
log.info(SaveManager.username +""+ snake.getLength());
}
});
......
......@@ -4,6 +4,7 @@ import javafx.fxml.FXML;
import javafx.scene.layout.AnchorPane;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.example.io.SaveManager;
public class SnakeGameControllerBezwinger extends AbstractSnakeGameController {
......@@ -20,7 +21,7 @@ public class SnakeGameControllerBezwinger extends AbstractSnakeGameController {
private void endGame() {
screen.getChildren().clear();
screen.getChildren().add(getScore());
getScore().setText("Game Over "+ getSnake().getLength());
getScore().setText("Game Over "+ SaveManager.username +" you're score is:" +getSnake().getLength());
music.interrupt();
}
......
src/main/resources/styles/thekle.png

992 KiB | W: | H:

src/main/resources/styles/thekle.png

362 KiB | W: | H:

src/main/resources/styles/thekle.png
src/main/resources/styles/thekle.png
src/main/resources/styles/thekle.png
src/main/resources/styles/thekle.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment