From a99bbcc274fb80e12e32b29037ea2475fb64fc53 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Sat, 29 Nov 2014 14:07:40 +0100 Subject: [PATCH] make VK_SPACE an accepted select key --- src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java | 5 +++-- src/de/teamteamteam/spacescooter/screen/GameOverScreen.java | 3 ++- .../teamteamteam/spacescooter/screen/GamePausedScreen.java | 6 ++++-- src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java | 3 ++- src/de/teamteamteam/spacescooter/screen/ShopScreen.java | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java b/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java index 1fa6407..0e3aac4 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java @@ -6,9 +6,9 @@ import de.teamteamteam.spacescooter.entity.shot.Shot; import de.teamteamteam.spacescooter.sound.SoundSystem; import de.teamteamteam.spacescooter.utility.Random; /** - * The Enemy class that handle all the Enemies out there. + * The Enemy class that handles all the Enemies out there. * Including bosses and minibosses. - * This class inherit all the properties of the enemies to every subclass + * This class inherits all the properties of the enemies to every subclass */ public abstract class Enemy extends ShootingEntity { @@ -41,6 +41,7 @@ public abstract class Enemy extends ShootingEntity { if(willShoot == true){ this.shoot(); } + // ToDo: ??? if(this.getX() < 0-this.getWidth()) { this.remove(); } diff --git a/src/de/teamteamteam/spacescooter/screen/GameOverScreen.java b/src/de/teamteamteam/spacescooter/screen/GameOverScreen.java index 0cc6a9d..6386598 100644 --- a/src/de/teamteamteam/spacescooter/screen/GameOverScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/GameOverScreen.java @@ -82,7 +82,8 @@ public class GameOverScreen extends Screen { player.setPosition(player.getX(), 309); } - if(Keyboard.isKeyDown(KeyEvent.VK_ENTER)) { + // make a selection + if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) || Keyboard.isKeyDown(KeyEvent.VK_SPACE)) { this.animationStatus = 1; } if(this.animationStatus == 1) { diff --git a/src/de/teamteamteam/spacescooter/screen/GamePausedScreen.java b/src/de/teamteamteam/spacescooter/screen/GamePausedScreen.java index 84dc43b..f7c603d 100644 --- a/src/de/teamteamteam/spacescooter/screen/GamePausedScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/GamePausedScreen.java @@ -77,9 +77,11 @@ public class GamePausedScreen extends Screen { player.setPosition(player.getX(), 309); } - if(Keyboard.isKeyDown(KeyEvent.VK_ENTER)) { - this.animationStatus = 1; + // make a selection + if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) || Keyboard.isKeyDown(KeyEvent.VK_SPACE)) { + animationStatus = 1; } + if(this.animationStatus == 1) { if(player.getX() <= GameConfig.windowWidth) { player.setPosition(player.getX() + (int)playerMoveSpeed, player.getY()); diff --git a/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java b/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java index 72a5b00..08c0ea3 100644 --- a/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java @@ -88,7 +88,8 @@ public class MainMenuScreen extends Screen { keyPressed = false; } - if(Keyboard.isKeyDown(KeyEvent.VK_ENTER)) { + // make a selection + if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) || Keyboard.isKeyDown(KeyEvent.VK_SPACE)) { animationStatus = 1; } diff --git a/src/de/teamteamteam/spacescooter/screen/ShopScreen.java b/src/de/teamteamteam/spacescooter/screen/ShopScreen.java index 96fa78d..48e7c9a 100644 --- a/src/de/teamteamteam/spacescooter/screen/ShopScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/ShopScreen.java @@ -70,7 +70,7 @@ public class ShopScreen extends Screen { this.player.setPosition(50, this.player.getY()); this.player.setPosition(this.player.getX(), 159+(this.menuPoint*100)); } - }else if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) && !this.keyPressed && this.animationStatus == 0) { + }else if ( (Keyboard.isKeyDown(KeyEvent.VK_ENTER) || Keyboard.isKeyDown(KeyEvent.VK_SPACE)) && !this.keyPressed && this.animationStatus == 0) { this.keyPressed = true; /////////////////////////////////////////////////////////////// switch (this.menuPoint) {