diff --git a/src/de/teamteamteam/spacescooter/datastructure/ConcurrentLinkedList.java b/src/de/teamteamteam/spacescooter/datastructure/ConcurrentLinkedList.java index 9a8b721..1ec4b9e 100644 --- a/src/de/teamteamteam/spacescooter/datastructure/ConcurrentLinkedList.java +++ b/src/de/teamteamteam/spacescooter/datastructure/ConcurrentLinkedList.java @@ -47,7 +47,7 @@ public class ConcurrentLinkedList { while(element.equals(currentNode.getValue()) == false && currentNode.hasNext()) { currentNode = currentNode.next(); } - if(currentNode.getValue().equals(element)) { + if(currentNode.getValue() != null && currentNode.getValue().equals(element)) { currentNode.setValue(null); return; } diff --git a/src/de/teamteamteam/spacescooter/screen/CreditsScreen.java b/src/de/teamteamteam/spacescooter/screen/CreditsScreen.java new file mode 100644 index 0000000..64fa6de --- /dev/null +++ b/src/de/teamteamteam/spacescooter/screen/CreditsScreen.java @@ -0,0 +1,47 @@ +package de.teamteamteam.spacescooter.screen; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.event.KeyEvent; + +import de.teamteamteam.spacescooter.brain.GameConfig; +import de.teamteamteam.spacescooter.control.Keyboard; +import de.teamteamteam.spacescooter.entity.enemy.EnemyOne; + +/** + * This is the Screen where you can look at all those awesome guys who created this game. :D + */ +public class CreditsScreen extends Screen { + + /** + * Default Constructor + */ + public CreditsScreen(Screen parent) { + super(parent); + } + + /** + * Draw the Credits :) + */ + @Override + protected void paint(Graphics2D g) { + g.setColor(new Color(0,0,120)); + g.fillRect(0, 0, GameConfig.windowWidth, GameConfig.windowHeight); + g.setColor(Color.WHITE); + g.setFont(new Font("Monospace", 0, 50)); + String text = "#yolo"; + g.drawString(text, (GameConfig.windowWidth - g.getFontMetrics().stringWidth(text))/2, 150); + } + + /** + * In case the Loader is done, immediately fire up the MainMenuScreen. + */ + @Override + protected void update() { + if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) || Keyboard.isKeyDown(KeyEvent.VK_SPACE)) { + this.parent.setOverlay(new MainMenuScreen(this.parent)); + } + } + +} diff --git a/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java b/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java index 31c5394..bac1066 100644 --- a/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java @@ -108,6 +108,7 @@ public class MainMenuScreen extends Screen { this.parent.setOverlay(new HighscoreScreen(this.parent)); break; case 3: + this.parent.setOverlay(new CreditsScreen(this.parent)); break; case 4: System.exit(0); diff --git a/src/de/teamteamteam/spacescooter/screen/Screen.java b/src/de/teamteamteam/spacescooter/screen/Screen.java index 09fb977..8f351ec 100644 --- a/src/de/teamteamteam/spacescooter/screen/Screen.java +++ b/src/de/teamteamteam/spacescooter/screen/Screen.java @@ -241,6 +241,8 @@ public abstract class Screen { if(this.processSetOverlayCall) { if(this.overlay != null) { this.overlay.cleanup(); + } else { + this.cleanup(); } if(this.newOverlay == null) { Screen.currentScreen = this;