From 6be6a9730692ac9c43fc195102620f87ad3bd1b6 Mon Sep 17 00:00:00 2001 From: Sosch Date: Tue, 2 Dec 2014 13:34:59 +0100 Subject: [PATCH] add Highscore Screen --- save | 20 +++++ .../spacescooter/screen/HighscoreScreen.java | 86 +++++++++++++++++++ .../spacescooter/screen/MainMenuScreen.java | 1 + 3 files changed, 107 insertions(+) create mode 100644 save create mode 100644 src/de/teamteamteam/spacescooter/screen/HighscoreScreen.java diff --git a/save b/save new file mode 100644 index 0000000..0900f7b --- /dev/null +++ b/save @@ -0,0 +1,20 @@ +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 \ No newline at end of file diff --git a/src/de/teamteamteam/spacescooter/screen/HighscoreScreen.java b/src/de/teamteamteam/spacescooter/screen/HighscoreScreen.java new file mode 100644 index 0000000..79baee3 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/screen/HighscoreScreen.java @@ -0,0 +1,86 @@ +package de.teamteamteam.spacescooter.screen; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.event.KeyEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Scanner; + +import de.teamteamteam.spacescooter.brain.GameConfig; +import de.teamteamteam.spacescooter.control.Keyboard; +import de.teamteamteam.spacescooter.entity.Player; +import de.teamteamteam.spacescooter.gui.Button; +import de.teamteamteam.spacescooter.utility.Loader; + +public class HighscoreScreen extends Screen{ + + private BufferedImage img; + private float playerMoveSpeed = 0; + private Player player; + private int animationStatus = 0; //0 = Animation noch nicht gestartet, 1 = Animation laeuft, 2 = Animation beendet + private ArrayList eintraege = new ArrayList(); + + public HighscoreScreen(Screen parent) { + super(parent); + this.img = Loader.getBufferedImageByFilename("images/earthbackground.png"); + new Button(GameConfig.windowWidth/2-125, GameConfig.windowHeight-75); + player = new Player(GameConfig.windowWidth/2-170, GameConfig.windowHeight-63); + player.setCanMove(false); + player.setCanShoot(false); + readHighscore(); + } + + @Override + protected void paint(Graphics2D g) { + g.drawImage(this.img, 0, 0, null); + this.entityPaintIterator.reset(); + while (this.entityPaintIterator.hasNext()) { + this.entityPaintIterator.next().paint(g); + } + g.setFont(new Font("Monospace", 0, 20)); + g.setColor(new Color(255, 255, 255)); + for(int i = 0; i