Add CreditsScreen Template.
This commit is contained in:
parent
f08d5ef6f5
commit
52152eccc1
@ -47,7 +47,7 @@ public class ConcurrentLinkedList<T> {
|
||||
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;
|
||||
}
|
||||
|
47
src/de/teamteamteam/spacescooter/screen/CreditsScreen.java
Normal file
47
src/de/teamteamteam/spacescooter/screen/CreditsScreen.java
Normal file
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user