diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/Enum/PlayerMode.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Enum/PlayerMode.java new file mode 100644 index 0000000000000000000000000000000000000000..fb864e26dcdce0777bc7301cfeb51007063ba46f --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Enum/PlayerMode.java @@ -0,0 +1,6 @@ +package de.hdm_stuttgart.battlearena.Controller.Enum; + +public enum PlayerMode { + PLAYER_ONE, + PLAYER_TWO +} \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java index 42f1f0f879960aba93f5d68cb53aaec6be3116ca..24da67aa7117aa7ad4f2091b4a6e816fa7c8a440 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java @@ -2,6 +2,7 @@ package de.hdm_stuttgart.battlearena.Controller; import de.hdm_stuttgart.battlearena.Controller.Enum.GameMode; import de.hdm_stuttgart.battlearena.Controller.Enum.GameState; +import de.hdm_stuttgart.battlearena.Controller.Enum.PlayerMode; import de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.RuntimeInfo; import de.hdm_stuttgart.battlearena.Model.Entity.EntityClass; import de.hdm_stuttgart.battlearena.Model.Entity.EntityFactory; @@ -75,11 +76,14 @@ public class GameSceneController implements Initializable { graphicsContext2D = canvas2D.getGraphicsContext2D(); graphicsContext2D.setImageSmoothing(false); - player = EntityFactory.createEntity(EntityType.PLAYER, graphicsContext2D, inputHandler, playerOneClass, this); + player = EntityFactory.createEntity(EntityType.PLAYER, graphicsContext2D, inputHandler, + playerOneClass, this, PlayerMode.PLAYER_ONE); if (gameMode == GameMode.NETWORK) { - enemy = EntityFactory.createEntity(EntityType.NETWORK_PLAYER_TWO, graphicsContext2D, inputHandler, playerTwoClass, this); + enemy = EntityFactory.createEntity(EntityType.NETWORK_PLAYER_TWO, graphicsContext2D, inputHandler, + playerTwoClass, this, PlayerMode.PLAYER_TWO); } else { - enemy = EntityFactory.createEntity(EntityType.LOKAL_PLAYER_TWO, graphicsContext2D, inputHandler, playerTwoClass, this); + enemy = EntityFactory.createEntity(EntityType.PLAYER, graphicsContext2D, inputHandler, + playerTwoClass, this, PlayerMode.PLAYER_TWO); } tileManager = new TileManager(graphicsContext2D, diffTileCount, horizontalTileCount, verticalTileCount, mapString); @@ -102,6 +106,7 @@ public class GameSceneController implements Initializable { player.updateEntityMovement(this); enemy.updateEntityMovement(this); player.attack(enemy, graphicsContext2D); + enemy.attack(player, graphicsContext2D); } private void renderContent(GraphicsContext graphicsContext) { @@ -114,6 +119,10 @@ public class GameSceneController implements Initializable { return enemy; } + public IEntity getPlayer() { + return player; + } + public TileManager getTileManager() { return tileManager; } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityFactory.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityFactory.java index 25f326f94ebea2f7f27dc33ec7cad176f466cd45..2e49bcaca57667a7fbea0431ff0fe8c91b356ac5 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityFactory.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityFactory.java @@ -1,5 +1,6 @@ package de.hdm_stuttgart.battlearena.Model.Entity; +import de.hdm_stuttgart.battlearena.Controller.Enum.PlayerMode; import de.hdm_stuttgart.battlearena.Controller.GameSceneController; import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; @@ -12,16 +13,14 @@ public class EntityFactory { private static final Logger log = LogManager.getLogger(EntityFactory.class); - public static IEntity createEntity(EntityType entityType, GraphicsContext gameScene, InputHandler inputHandler, EntityClass entityClass, GameSceneController gameSceneController) { + public static IEntity createEntity(EntityType entityType, GraphicsContext gameScene, InputHandler inputHandler, + EntityClass entityClass, GameSceneController gameSceneController, PlayerMode playerMode) { if (entityType == EntityType.PLAYER) { log.debug("Entity " + entityType + " created"); - return new Player(gameScene, inputHandler, entityClass, gameSceneController); + return new Player(gameScene, inputHandler, entityClass, gameSceneController, playerMode); } else if (entityType == EntityType.NETWORK_PLAYER_TWO) { log.debug("Entity " + entityType + " created"); return new NetworkPlayerTwo(); - } else if (entityType == EntityType.LOKAL_PLAYER_TWO) { - log.debug("Entity " + entityType + " created"); - return new LocalPlayerTwo(); } throw new IllegalArgumentException ("Entity type not supported " + entityType); diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/IEntity.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/IEntity.java index 92ca5b53906697c1bad96c2cbb59524b7bc2c40b..81dc56534d0b1dece4043fa1c16ea98a94463b2c 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/IEntity.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/IEntity.java @@ -24,7 +24,7 @@ public interface IEntity { int getEntitySpeed(); - int gotHit(int damageDone); + void gotHit(int damageDone); int getMapPosX(); diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/LocalPlayerTwo.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/LocalPlayerTwo.java deleted file mode 100644 index cf51c0fc5cc0272bef91dfaca1a168f63b0fc0dd..0000000000000000000000000000000000000000 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/LocalPlayerTwo.java +++ /dev/null @@ -1,72 +0,0 @@ -package de.hdm_stuttgart.battlearena.Model.Entity; - -import de.hdm_stuttgart.battlearena.Controller.GameSceneController; -import javafx.geometry.BoundingBox; -import javafx.scene.canvas.GraphicsContext; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; - -public class LocalPlayerTwo implements IEntity{ - - private static final Logger log = LogManager.getLogger(LocalPlayerTwo.class); - - @Override - public void initializeEntity() { - - } - - @Override - public void loadEntitySprites() { - - } - - @Override - public void updateEntityMovement(GameSceneController gameScene) { - - } - - @Override - public void attack(IEntity entity, GraphicsContext graphicsContext) { - - } - - @Override - public void updateEntityWalkAnimation() { - - } - - @Override - public void renderEntity(GraphicsContext graphicsContext) { - - } - - @Override - public BoundingBox getBoxCollider() { - return null; - } - - @Override - public EntityDirection getEntityDirection() { - return null; - } - - @Override - public int getEntitySpeed() { - return 0; - } - - @Override - public int gotHit(int damageDone) { - return 0; - } - - @Override - public int getMapPosX() { - return 0; - } - - @Override - public int getMapPosY() { - return 0; - } -} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/NetworkPlayerTwo.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/NetworkPlayerTwo.java index 61aecddf8bd0c378ddab114851b9d4527df5ae5b..d42c173d9bbf3ac3d83012cfa12f6fa5afbb7d74 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/NetworkPlayerTwo.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/NetworkPlayerTwo.java @@ -68,9 +68,9 @@ class NetworkPlayerTwo implements IEntity{ } @Override - public int gotHit(int damageDone) { - log.debug(health); - return health -= damageDone; + public void gotHit(int damageDone) { + log.debug("Network player health: " + health); + health -= damageDone; } @Override diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/Player.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/Player.java index fffccf712e14e8a655bbc72622fae7e4c0d5d3b8..4eb9e644dc7e669fe7e28cdee9e4822f01d8dfb7 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/Player.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/Player.java @@ -1,5 +1,6 @@ package de.hdm_stuttgart.battlearena.Model.Entity; +import de.hdm_stuttgart.battlearena.Controller.Enum.PlayerMode; import de.hdm_stuttgart.battlearena.Controller.GameSceneController; import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; @@ -16,6 +17,8 @@ class Player implements IEntity { private static final Logger log = LogManager.getLogger(Player.class); + private final PlayerMode PLAYER_MODE; + InputHandler inputHandler; CollisionHandler collisionHandler = new CollisionHandler(); @@ -51,17 +54,24 @@ class Player implements IEntity { private int mapPosX; private int mapPosY; + + private int lastMapPosX; + private int lastMapPosY; + private int playerSpeed; private EntityDirection playerDirection; - private int health = 10; - private int damage = 1; + private int health; + private int maxPlayerHealth; + private int damage; - public Player(GraphicsContext gameScene, InputHandler inputHandler, EntityClass entityClass, GameSceneController gameSceneController) { + public Player(GraphicsContext gameScene, InputHandler inputHandler, EntityClass entityClass, + GameSceneController gameSceneController, PlayerMode PLAYER_MODE) { this.gameScene = gameScene; this.inputHandler = inputHandler; this.entityClass = entityClass; this.gameSceneController = gameSceneController; + this.PLAYER_MODE = PLAYER_MODE; initializeEntity(); loadEntitySprites(); @@ -70,13 +80,44 @@ class Player implements IEntity { @Override public void initializeEntity() { scaledTileSize = gameSceneController.getScaledTileSize(); - mapPosX = 60; - mapPosY = 60; - boxCollider = new BoundingBox(mapPosX+15,mapPosY+10, playerWidth, playerHeight); - playerSpeed = 5; + if (PLAYER_MODE == PlayerMode.PLAYER_ONE) { + mapPosX = 60; + mapPosY = 60; + } else if (PLAYER_MODE == PlayerMode.PLAYER_TWO) { + mapPosX = 760; + mapPosY = 735; + } + + initializePlayerStats(); + + boxCollider = new BoundingBox(mapPosX + 15, mapPosY + 10, playerWidth, playerHeight); playerDirection = EntityDirection.DOWN; } + private void initializePlayerStats() { + if (entityClass == EntityClass.HUMAN) { + maxPlayerHealth = 50; + health = 50; + damage = 5; + playerSpeed = 5; + } else if (entityClass == EntityClass.HIGH_BORN) { + maxPlayerHealth = 100; + health = 70; + damage = 2; + playerSpeed = 3; + } else if (entityClass == EntityClass.LOW_BORN) { + maxPlayerHealth = 10; + health = 10; + damage = 10; + playerSpeed = 7; + } else { + maxPlayerHealth = 30; + health = 15; + damage = 7; + playerSpeed = 5; + } + } + @Override public void loadEntitySprites() { try { @@ -140,7 +181,7 @@ class Player implements IEntity { directionLeftTwo = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/player/leftTwo.png"))); directionRightOne = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/player/rightOne.png"))); directionRightTwo = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/player/rightTwo.png"))); - } + } private void loadWeaponSprites() { swordUp = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/weapons/SwordUp.png"))); @@ -151,58 +192,90 @@ class Player implements IEntity { @Override public void updateEntityMovement(GameSceneController gameScene) { - if (inputHandler.isMoveUp() || inputHandler.isMoveDown() || inputHandler.isMoveLeft() || inputHandler.isMoveRight()) { - if (inputHandler.isMoveUp()) { - playerDirection = EntityDirection.UP; - } else if (inputHandler.isMoveDown()) { - playerDirection = EntityDirection.DOWN; - } else if (inputHandler.isMoveLeft()) { - playerDirection = EntityDirection.LEFT; - } else { - playerDirection = EntityDirection.RIGHT; - } - - boolean isWalkableTile = collisionHandler.handleMapCollision(this, scaledTileSize, gameSceneController); - - int lastMapPosX = mapPosX; - int lastMapPosY = mapPosY; - - if (isWalkableTile) { - switch (playerDirection) { - case UP: - mapPosY -= playerSpeed; - break; - case DOWN: - mapPosY += playerSpeed; - break; - case LEFT: - mapPosX -= playerSpeed; - break; - case RIGHT: - mapPosX += playerSpeed; + if (PLAYER_MODE == PlayerMode.PLAYER_ONE) { + if (inputHandler.isMoveUp() || inputHandler.isMoveDown() || inputHandler.isMoveLeft() || inputHandler.isMoveRight()) { + if (inputHandler.isMoveUp()) { + playerDirection = EntityDirection.UP; + } else if (inputHandler.isMoveDown()) { + playerDirection = EntityDirection.DOWN; + } else if (inputHandler.isMoveLeft()) { + playerDirection = EntityDirection.LEFT; + } else if (inputHandler.isMoveRight()) { + playerDirection = EntityDirection.RIGHT; } - } - boolean isEntityCollision = boxCollider.intersects(gameScene.getEnemy().getBoxCollider()); - //boolean isEntityCollision = collisionHandler.handleBoxCollision(boxCollider, gameScene.getEnemy().getBoxCollider()); - - if (isEntityCollision) { - if (playerDirection == EntityDirection.UP) { - mapPosY = lastMapPosY + 30; - } else if (playerDirection == EntityDirection.DOWN) { - mapPosY = lastMapPosY - 30; - } else if (playerDirection == EntityDirection.LEFT) { - mapPosX = lastMapPosX + 30; - } else { - mapPosX = lastMapPosX - 30; - } + boolean isWalkableTile = collisionHandler.handleMapCollision(this, scaledTileSize, gameSceneController); + + performEntityMovement(isWalkableTile); + + boolean isEntityCollision = boxCollider.intersects(gameScene.getEnemy().getBoxCollider()); + //boolean isEntityCollision = collisionHandler.handleBoxCollision(boxCollider, gameScene.getEnemy().getBoxCollider()); + + performEntityCollision(isEntityCollision); + + updateEntityWalkAnimation(); } + } else if (PLAYER_MODE == PlayerMode.PLAYER_TWO) { + if (inputHandler.isSdMoveUp() || inputHandler.isSdMoveDown() || inputHandler.isSdMoveLeft() || inputHandler.isSdMoveRight()) { + if (inputHandler.isSdMoveUp()) { + playerDirection = EntityDirection.UP; + } else if (inputHandler.isSdMoveDown()) { + playerDirection = EntityDirection.DOWN; + } else if (inputHandler.isSdMoveLeft()) { + playerDirection = EntityDirection.LEFT; + } else if (inputHandler.isSdMoveRight()) { + playerDirection = EntityDirection.RIGHT; + } + + boolean isWalkableTile = collisionHandler.handleMapCollision(this, scaledTileSize, gameSceneController); + + performEntityMovement(isWalkableTile); + + boolean isEntityCollision = boxCollider.intersects(gameScene.getPlayer().getBoxCollider()); + //boolean isEntityCollision = collisionHandler.handleBoxCollision(boxCollider, gameScene.getEnemy().getBoxCollider()); - boxCollider = new BoundingBox(mapPosX+15,mapPosY+10, playerWidth, playerHeight); + performEntityCollision(isEntityCollision); - updateEntityWalkAnimation(); + updateEntityWalkAnimation(); + } + } + } + + private void performEntityMovement(boolean isWalkableTile) { + lastMapPosX = mapPosX; + lastMapPosY = mapPosY; + + if (isWalkableTile) { + switch (playerDirection) { + case UP: + mapPosY -= playerSpeed; + break; + case DOWN: + mapPosY += playerSpeed; + break; + case LEFT: + mapPosX -= playerSpeed; + break; + case RIGHT: + mapPosX += playerSpeed; + } + } + } + private void performEntityCollision(boolean isEntityCollision) { + if (isEntityCollision) { + if (playerDirection == EntityDirection.UP) { + mapPosY = lastMapPosY + 30; + } else if (playerDirection == EntityDirection.DOWN) { + mapPosY = lastMapPosY - 30; + } else if (playerDirection == EntityDirection.LEFT) { + mapPosX = lastMapPosX + 30; + } else { + mapPosX = lastMapPosX - 30; + } } + + boxCollider = new BoundingBox(mapPosX + 15, mapPosY + 10, playerWidth, playerHeight); } @Override @@ -214,39 +287,40 @@ class Player implements IEntity { int attackRange = 30; int attackWidth = 10; - if (inputHandler.isAttack()){ + if (inputHandler.isAttack() && PLAYER_MODE == PlayerMode.PLAYER_ONE || + inputHandler.isSdAttack() && PLAYER_MODE == PlayerMode.PLAYER_TWO) { if (playerDirection == EntityDirection.UP) { - hitBox = new BoundingBox(mapPosX+playerWidth, mapPosY-10, attackWidth, attackRange); - graphicsContext.strokeRect(mapPosX+playerWidth, mapPosY-10, attackWidth, attackRange); - graphicsContext.drawImage(swordUp, mapPosX+8, mapPosY-10, 32, 32); + hitBox = new BoundingBox(mapPosX + playerWidth, mapPosY - 10, attackWidth, attackRange); + graphicsContext.strokeRect(mapPosX + playerWidth, mapPosY - 10, attackWidth, attackRange); + graphicsContext.drawImage(swordUp, mapPosX + 8, mapPosY - 10, 32, 32); if (hitBox.intersects(entity.getBoxCollider())) { entity.gotHit(damage); graphicsContext.strokeText("Hit", 10, 10); } } else if (playerDirection == EntityDirection.DOWN) { - hitBox = new BoundingBox(mapPosX+playerWidth, mapPosY+playerHeight, attackWidth, attackRange); - graphicsContext.strokeRect(mapPosX+playerWidth, mapPosY+playerHeight, attackWidth, attackRange); - graphicsContext.drawImage(swordDown, mapPosX+8, mapPosY+playerHeight, 32, 32); + hitBox = new BoundingBox(mapPosX + playerWidth, mapPosY + playerHeight, attackWidth, attackRange); + graphicsContext.strokeRect(mapPosX + playerWidth, mapPosY + playerHeight, attackWidth, attackRange); + graphicsContext.drawImage(swordDown, mapPosX + 8, mapPosY + playerHeight, 32, 32); if (hitBox.intersects(entity.getBoxCollider())) { entity.gotHit(damage); graphicsContext.strokeText("Hit", 10, 10); } } else if (playerDirection == EntityDirection.LEFT) { - hitBox = new BoundingBox(mapPosX-attackWidth, mapPosY+((double) playerHeight /2), + hitBox = new BoundingBox(mapPosX - attackWidth, mapPosY + ((double) playerHeight / 2), attackRange, attackWidth); - graphicsContext.strokeRect(mapPosX-attackWidth, mapPosY+((double) playerHeight /2), + graphicsContext.strokeRect(mapPosX - attackWidth, mapPosY + ((double) playerHeight / 2), attackRange, attackWidth); - graphicsContext.drawImage(swordLeft, mapPosX-8, mapPosY+8, 32, 32); + graphicsContext.drawImage(swordLeft, mapPosX - 8, mapPosY + 8, 32, 32); if (hitBox.intersects(entity.getBoxCollider())) { entity.gotHit(damage); graphicsContext.strokeText("Hit", 10, 10); } } else { - hitBox = new BoundingBox(mapPosX+playerWidth+attackWidth, mapPosY+((double) playerHeight /2), + hitBox = new BoundingBox(mapPosX + playerWidth + attackWidth, mapPosY + ((double) playerHeight / 2), attackRange, attackWidth); - graphicsContext.strokeRect(mapPosX+playerWidth+attackWidth, mapPosY+((double) playerHeight /2), + graphicsContext.strokeRect(mapPosX + playerWidth + attackWidth, mapPosY + ((double) playerHeight / 2), attackRange, attackWidth); - graphicsContext.drawImage(swordRight, mapPosX+playerWidth+8, mapPosY+8, 32, 32); + graphicsContext.drawImage(swordRight, mapPosX + playerWidth + 8, mapPosY + 8, 32, 32); if (hitBox.intersects(entity.getBoxCollider())) { entity.gotHit(damage); graphicsContext.strokeText("Hit", 10, 10); @@ -274,7 +348,7 @@ class Player implements IEntity { Image playerSprite = null; //for debugging collision - graphicsContext.strokeRect(mapPosX+15,mapPosY+10, playerWidth, playerHeight); + graphicsContext.strokeRect(mapPosX + 15, mapPosY + 10, playerWidth, playerHeight); switch (playerDirection) { case UP: @@ -314,6 +388,22 @@ class Player implements IEntity { graphicsContext.drawImage(playerSprite, mapPosX, mapPosY, 48, 48); } + @Override + public void gotHit(int damageDone) { + health -= damageDone; + } + + private void healPlayer(int healthRegenerated) { + int regeneratedHealth = health + healthRegenerated; + + if (regeneratedHealth < maxPlayerHealth) { + health += healthRegenerated; + } else { + health = maxPlayerHealth; + } + + } + @Override public BoundingBox getBoxCollider() { return boxCollider; @@ -329,11 +419,6 @@ class Player implements IEntity { return playerSpeed; } - @Override - public int gotHit(int damageDone) { - return health -= damageDone; - } - @Override public int getMapPosX() { return mapPosX; diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Inputs/InputHandler.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Inputs/InputHandler.java index 8dfd2f3d3d51063e409488e71a25814030ed2f68..a66f47e852aac620010f786bbff62a0700292535 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Inputs/InputHandler.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Inputs/InputHandler.java @@ -18,26 +18,51 @@ public class InputHandler { return inputHandler; } + //Local Player/Player one controls private boolean moveUp, moveDown, moveLeft, moveRight, attack; + //Local player two controls + private boolean sdMoveUp, sdMoveDown, sdMoveLeft, sdMoveRight, sdAttack; + public void handleKeyPress(KeyEvent event) { KeyCode code = event.getCode(); switch (code) { case W: moveUp = true; + log.debug("Player move up"); break; case S: moveDown = true; + log.debug("Player move down"); break; case A: moveLeft = true; + log.debug("Player move left"); break; case D: moveRight = true; + log.debug("Player move right"); break; - case SPACE: + case E: attack = true; + log.debug("Player attack"); + break; + case UP: + sdMoveUp = true; + break; + case DOWN: + sdMoveDown = true; + break; + case LEFT: + sdMoveLeft = true; + break; + case RIGHT: + sdMoveRight = true; + break; + case MINUS: + sdAttack = true; + break; } } @@ -57,8 +82,24 @@ public class InputHandler { case D: moveRight = false; break; - case SPACE: + case E: attack = false; + break; + case UP: + sdMoveUp = false; + break; + case DOWN: + sdMoveDown = false; + break; + case LEFT: + sdMoveLeft = false; + break; + case RIGHT: + sdMoveRight = false; + break; + case MINUS: + sdAttack = false; + break; } } @@ -81,4 +122,24 @@ public class InputHandler { public boolean isAttack() { return attack; } + + public boolean isSdMoveUp() { + return sdMoveUp; + } + + public boolean isSdMoveDown() { + return sdMoveDown; + } + + public boolean isSdMoveLeft() { + return sdMoveLeft; + } + + public boolean isSdMoveRight() { + return sdMoveRight; + } + + public boolean isSdAttack() { + return sdAttack; + } } \ No newline at end of file