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 5b490adc8bf54a93797c501e974081b25cbc9b7b..9c8b490df483b17ae295a4ecfe3f275f4c34990e 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java @@ -1,10 +1,68 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Model.Entity.EntityFactory; +import de.hdm_stuttgart.battlearena.Model.Entity.EntityType; +import de.hdm_stuttgart.battlearena.Model.Entity.IEntity; +import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; + +import javafx.animation.AnimationTimer; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.canvas.Canvas; +import javafx.scene.canvas.GraphicsContext; + import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; -public class GameSceneController { +import java.net.URL; +import java.util.ResourceBundle; + +public class GameSceneController implements Initializable { private static final Logger log = LogManager.getLogger(GameSceneController.class); -} + @FXML + private Canvas canvas2D; + + private GraphicsContext graphicsContext2D; + + InputHandler inputHandler = InputHandler.getInstance(); + + IEntity player; + IEntity enemy; + + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + graphicsContext2D = canvas2D.getGraphicsContext2D(); + + player = EntityFactory.createEntity(EntityType.PLAYER, graphicsContext2D, inputHandler); + enemy = EntityFactory.createEntity(EntityType.ENEMY_PLAYER, graphicsContext2D, inputHandler); + + AnimationTimer gameLoop = new AnimationTimer() { + @Override + public void handle(long l) { + graphicsContext2D.clearRect(0, 0, canvas2D.getWidth(), canvas2D.getHeight()); + updateContent(); + renderContent(graphicsContext2D); + } + }; + gameLoop.start(); + log.debug("Game loop started"); + } + + private void updateContent() { + player.updateEntityMovement(this); + enemy.updateEntityMovement(this); + player.attack(enemy, graphicsContext2D); + } + + private void renderContent(GraphicsContext graphicsContext) { + player.renderEntity(graphicsContext); + enemy.renderEntity(graphicsContext); + } + + public IEntity getEnemy() { + return enemy; + } +} \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Main/Main.java b/src/main/java/de/hdm_stuttgart/battlearena/Main/Main.java index f2952c692546cd275924f9d299819d2f70c7a7bf..db7be08c430fdc16415e617929e3488bc5c148f0 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Main/Main.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Main/Main.java @@ -1,5 +1,6 @@ package de.hdm_stuttgart.battlearena.Main; +import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; @@ -15,16 +16,21 @@ public class Main extends Application { private static final Logger log = LogManager.getLogger(Main.class); + InputHandler inputHandler = InputHandler.getInstance(); + public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { - Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MainMenu.fxml"))); + Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/GameScene.fxml"))); Scene scene = new Scene(root); + scene.setOnKeyPressed(inputHandler::handleKeyPress); + scene.setOnKeyReleased(inputHandler::handleKeyRelease); + stage.setTitle("BattleArena"); stage.setScene(scene); diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/CollisionHandler.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/CollisionHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..030f3cc715602f835b7db2e95fb3552d76968dac --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/CollisionHandler.java @@ -0,0 +1,27 @@ +package de.hdm_stuttgart.battlearena.Model.Entity; + +import javafx.geometry.BoundingBox; + +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + +public class CollisionHandler { + + private static final Logger log = LogManager.getLogger(CollisionHandler.class); + + public CollisionHandler() { + log.debug("CollisionHandler initialized"); + } + + public boolean handleBoxCollision(BoundingBox colliderA, BoundingBox colliderB) { + return colliderA.getMaxX() > colliderB.getMinX() && + colliderA.getMinX() < colliderB.getMaxX() && + colliderA.getMaxY() > colliderB.getMinY() && + colliderA.getMinY() < colliderB.getMaxY(); + } + + public boolean handleMapCollision() { + return false; + } + +} \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EnemyHandler.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EnemyHandler.java index ea46bb6f0ff8235e038455fde192db494e789f94..a34f2234082ae2840c1039d6c4ffac034321c88a 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EnemyHandler.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EnemyHandler.java @@ -1,10 +1,68 @@ package de.hdm_stuttgart.battlearena.Model.Entity; +import de.hdm_stuttgart.battlearena.Controller.GameSceneController; + +import javafx.geometry.BoundingBox; +import javafx.scene.canvas.GraphicsContext; +import javafx.scene.paint.Color; + import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; -public class EnemyHandler { +class EnemyHandler implements IEntity{ private static final Logger log = LogManager.getLogger(EnemyHandler.class); -} + private final BoundingBox boxCollider = new BoundingBox(300, 200, 48, 48); + + private EntityDirection entityDirection = EntityDirection.DOWN; + + private int entitySpeed = 3; + + @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) { + graphicsContext.setFill(Color.BLACK); + graphicsContext.fillRect(300, 200, 48, 48); + } + + @Override + public BoundingBox getBoxCollider() { + return boxCollider; + } + + @Override + public EntityDirection getEntityDirection() { + return entityDirection; + } + + @Override + public int getEntitySpeed() { + return 3; + } + +} \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityDirection.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityDirection.java new file mode 100644 index 0000000000000000000000000000000000000000..c86d3e0e25d51cf090cede9ef3a3167745be7d0a --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityDirection.java @@ -0,0 +1,8 @@ +package de.hdm_stuttgart.battlearena.Model.Entity; + +public enum EntityDirection { + UP, + DOWN, + LEFT, + RIGHT +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..189243ff476d3e4a545dbd2ec2cec155e5159613 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityFactory.java @@ -0,0 +1,26 @@ +package de.hdm_stuttgart.battlearena.Model.Entity; + +import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; + +import javafx.scene.canvas.GraphicsContext; + +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + +public class EntityFactory { + + private static final Logger log = LogManager.getLogger(EntityFactory.class); + + public static IEntity createEntity(EntityType entityType, GraphicsContext gameScene, InputHandler inputHandler) { + if (entityType == EntityType.PLAYER) { + log.debug("Entity " + entityType + " created"); + return new Player(gameScene, inputHandler); + } else if (entityType == EntityType.ENEMY_PLAYER) { + log.debug("Entity " + entityType + " created"); + return new EnemyHandler(); + } + + throw new IllegalArgumentException ("Entity type not supported " + entityType); + } + +} \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityType.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityType.java new file mode 100644 index 0000000000000000000000000000000000000000..3e8560772b2e9f049e217bdeca99c30c24150e11 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/EntityType.java @@ -0,0 +1,6 @@ +package de.hdm_stuttgart.battlearena.Model.Entity; + +public enum EntityType { + PLAYER, + ENEMY_PLAYER +} \ No newline at end of file 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 fd7bbc62dab3dc4952f7a50958d25bb42cf95b5a..9f0d341285a0afb78d5f047ae6d976a966712795 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 @@ -1,4 +1,27 @@ package de.hdm_stuttgart.battlearena.Model.Entity; +import de.hdm_stuttgart.battlearena.Controller.GameSceneController; +import javafx.geometry.BoundingBox; +import javafx.scene.canvas.GraphicsContext; + public interface IEntity { -} + + void initializeEntity(); + + void loadEntitySprites(); + + void updateEntityMovement(GameSceneController gameScene); + + void attack(IEntity entity, GraphicsContext graphicsContext); + + void updateEntityWalkAnimation(); + + void renderEntity(GraphicsContext graphicsContext); + + BoundingBox getBoxCollider(); + + EntityDirection getEntityDirection(); + + int getEntitySpeed(); + +} \ No newline at end of file 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 0384286b6f19eb3b2cd302cd23687b741eef2722..838affe1b64f8a582f9b722e102c15b6cf735f92 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,10 +1,273 @@ package de.hdm_stuttgart.battlearena.Model.Entity; +import de.hdm_stuttgart.battlearena.Controller.GameSceneController; +import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; + +import javafx.geometry.BoundingBox; +import javafx.scene.canvas.GraphicsContext; +import javafx.scene.image.Image; + import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; -public class Player implements IEntity { +import java.util.Objects; + +class Player implements IEntity { private static final Logger log = LogManager.getLogger(Player.class); -} + InputHandler inputHandler; + CollisionHandler collisionHandler = new CollisionHandler(); + + GraphicsContext gameScene; + + private BoundingBox boxCollider; + + private Image directionDownOne, + directionDownTwo, + directionUpOne, + directionUpTwo, + directionLeftOne, + directionLeftTwo, + directionRightOne, + directionRightTwo; + + private Image swordDown, + swordUp, + swordLeft, + swordRight; + + private int spriteCounter = 0; + private int spriteNumber = 1; + + private final int playerWidth = 19; + private final int playerHeight = 35; + + private int mapPosX; + private int mapPosY; + private int playerSpeed; + private EntityDirection playerDirection; + + public Player(GraphicsContext gameScene, InputHandler inputHandler) { + this.gameScene = gameScene; + this.inputHandler = inputHandler; + + initializeEntity(); + loadEntitySprites(); + } + + @Override + public void initializeEntity() { + mapPosX = 10; + mapPosY = 10; + boxCollider = new BoundingBox(mapPosX+15,mapPosY+10, playerWidth, playerHeight); + playerSpeed = 3; + playerDirection = EntityDirection.DOWN; + } + + @Override + public void loadEntitySprites() { + try { + directionDownOne = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/player/downOne.png"))); + directionDownTwo = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/player/downTwo.png"))); + directionUpOne = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/player/upOne.png"))); + directionUpTwo = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/player/upTwo.png"))); + directionLeftOne = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/player/leftOne.png"))); + 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"))); + swordUp = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/weapons/SwordUp.png"))); + swordDown = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/weapons/SwordDown.png"))); + swordLeft = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/weapons/SwordLeft.png"))); + swordRight = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/weapons/SwordRight.png"))); + } catch (Exception e) { + log.error(e); + } + } + + @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 isMapCollision = collisionHandler.handleMapCollision(); + + int lastMapPosX = mapPosX; + int lastMapPosY = mapPosY; + + if (!isMapCollision) { + switch (playerDirection) { + case UP: + mapPosY -= playerSpeed; + break; + case DOWN: + mapPosY += playerSpeed; + break; + case LEFT: + mapPosX -= playerSpeed; + break; + case RIGHT: + mapPosX += playerSpeed; + } + } + + 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; + } + } + + boxCollider = new BoundingBox(mapPosX+15,mapPosY+10, playerWidth, playerHeight); + + updateEntityWalkAnimation(); + + } + } + + @Override + public void attack(IEntity entity, GraphicsContext graphicsContext) { + BoundingBox hitBox; + int attackRange = 30; + int attackWidth = 10; + + if (inputHandler.isAttack()){ + 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); + if (hitBox.intersects(entity.getBoxCollider())) { + //todo: implement health + 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); + if (hitBox.intersects(entity.getBoxCollider())) { + //todo: implement health + graphicsContext.strokeText("Hit", 10, 10); + } + } else if (playerDirection == EntityDirection.LEFT) { + hitBox = new BoundingBox(mapPosX-attackWidth, mapPosY+((double) playerHeight /2), + attackRange, attackWidth); + graphicsContext.strokeRect(mapPosX-attackWidth, mapPosY+((double) playerHeight /2), + attackRange, attackWidth); + graphicsContext.drawImage(swordLeft, mapPosX-8, mapPosY+8, 32, 32); + if (hitBox.intersects(entity.getBoxCollider())) { + //todo: implement health + graphicsContext.strokeText("Hit", 10, 10); + } + } else { + hitBox = new BoundingBox(mapPosX+playerWidth+attackWidth, mapPosY+((double) playerHeight /2), + attackRange, attackWidth); + graphicsContext.strokeRect(mapPosX+playerWidth+attackWidth, mapPosY+((double) playerHeight /2), + attackRange, attackWidth); + graphicsContext.drawImage(swordRight, mapPosX+playerWidth+8, mapPosY+8, 32, 32); + if (hitBox.intersects(entity.getBoxCollider())) { + //todo: implement health + graphicsContext.strokeText("Hit", 10, 10); + } + } + } + } + + @Override + public void updateEntityWalkAnimation() { + spriteCounter++; + + if (spriteCounter > 10) { + if (spriteNumber == 1) { + spriteNumber = 2; + } else if (spriteNumber == 2) { + spriteNumber = 1; + } + spriteCounter = 0; + } + } + + @Override + public void renderEntity(GraphicsContext graphicsContext) { + Image playerSprite = null; + + //for debugging collision + graphicsContext.strokeRect(mapPosX+15,mapPosY+10, playerWidth, playerHeight); + + switch (playerDirection) { + case UP: + if (spriteNumber == 1) { + playerSprite = directionUpOne; + } + if (spriteNumber == 2) { + playerSprite = directionUpTwo; + } + break; + case DOWN: + if (spriteNumber == 1) { + playerSprite = directionDownOne; + } + if (spriteNumber == 2) { + playerSprite = directionDownTwo; + } + break; + case LEFT: + if (spriteNumber == 1) { + playerSprite = directionLeftOne; + } + if (spriteNumber == 2) { + playerSprite = directionLeftTwo; + } + break; + case RIGHT: + if (spriteNumber == 1) { + playerSprite = directionRightOne; + } + if (spriteNumber == 2) { + playerSprite = directionRightTwo; + } + break; + } + + graphicsContext.drawImage(playerSprite, mapPosX, mapPosY, 48, 48); + } + + @Override + public BoundingBox getBoxCollider() { + return boxCollider; + } + + @Override + public EntityDirection getEntityDirection() { + return playerDirection; + } + + @Override + public int getEntitySpeed() { + return playerSpeed; + } + + public int getMapPosX() { + return mapPosX; + } + + public int getMapPosY() { + return mapPosY; + } + +} \ No newline at end of file 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 5772a4785203b4a51e58738825772f37c11816b3..8dfd2f3d3d51063e409488e71a25814030ed2f68 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 @@ -1,5 +1,8 @@ package de.hdm_stuttgart.battlearena.Model.Inputs; +import javafx.scene.input.KeyCode; +import javafx.scene.input.KeyEvent; + import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; @@ -7,4 +10,75 @@ public class InputHandler { private static final Logger log = LogManager.getLogger(InputHandler.class); -} + private static final InputHandler inputHandler = new InputHandler(); + + private InputHandler(){} + + public static InputHandler getInstance() { + return inputHandler; + } + + private boolean moveUp, moveDown, moveLeft, moveRight, attack; + + public void handleKeyPress(KeyEvent event) { + KeyCode code = event.getCode(); + + switch (code) { + case W: + moveUp = true; + break; + case S: + moveDown = true; + break; + case A: + moveLeft = true; + break; + case D: + moveRight = true; + break; + case SPACE: + attack = true; + } + } + + public void handleKeyRelease(KeyEvent event) { + KeyCode code = event.getCode(); + + switch (code) { + case W: + moveUp = false; + break; + case S: + moveDown = false; + break; + case A: + moveLeft = false; + break; + case D: + moveRight = false; + break; + case SPACE: + attack = false; + } + } + + public boolean isMoveUp() { + return moveUp; + } + + public boolean isMoveDown() { + return moveDown; + } + + public boolean isMoveLeft() { + return moveLeft; + } + + public boolean isMoveRight() { + return moveRight; + } + + public boolean isAttack() { + return attack; + } +} \ No newline at end of file diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index fdd0d1f6d210d6e1dcaaa42982871ac052341a1a..d96f6e3f56d576a7eb684a25de56bac90130c06f 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -6,6 +6,8 @@ module gui { opens de.hdm_stuttgart.battlearena to javafx.fxml; + opens de.hdm_stuttgart.battlearena.Controller to javafx.fxml; exports de.hdm_stuttgart.battlearena.Main; exports de.hdm_stuttgart.battlearena.Controller; + exports de.hdm_stuttgart.battlearena.Model.Entity; } diff --git a/src/main/resources/fxml/GameScene.fxml b/src/main/resources/fxml/GameScene.fxml index b8a97acf0ac20383de9eb2086ae9b0c3e6e370a3..f6f5b8cd737838ead77cba00d573bf5bf630dca6 100644 --- a/src/main/resources/fxml/GameScene.fxml +++ b/src/main/resources/fxml/GameScene.fxml @@ -1,8 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> +<?import javafx.scene.canvas.Canvas?> <?import javafx.scene.layout.AnchorPane?> +<?import javafx.scene.layout.StackPane?> <AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.GameSceneController"> - + <children> + <StackPane prefHeight="400.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <children> + <Canvas fx:id="canvas2D" height="400.0" width="600.0" /> + </children> + </StackPane> + </children> </AnchorPane> diff --git a/src/main/resources/textures/player/downOne.png b/src/main/resources/textures/player/downOne.png new file mode 100644 index 0000000000000000000000000000000000000000..d1e261cc01b3a32bf937536716162ec5c61d0d50 Binary files /dev/null and b/src/main/resources/textures/player/downOne.png differ diff --git a/src/main/resources/textures/player/downTwo.png b/src/main/resources/textures/player/downTwo.png new file mode 100644 index 0000000000000000000000000000000000000000..9a14543c8d06be035ea8048428faeaa218faec32 Binary files /dev/null and b/src/main/resources/textures/player/downTwo.png differ diff --git a/src/main/resources/textures/player/leftOne.png b/src/main/resources/textures/player/leftOne.png new file mode 100644 index 0000000000000000000000000000000000000000..13cc7b495f2647d10917ebda3046cd8af32f9553 Binary files /dev/null and b/src/main/resources/textures/player/leftOne.png differ diff --git a/src/main/resources/textures/player/leftTwo.png b/src/main/resources/textures/player/leftTwo.png new file mode 100644 index 0000000000000000000000000000000000000000..cbed81ae3a90ef128cb1bd913329c211c69030bd Binary files /dev/null and b/src/main/resources/textures/player/leftTwo.png differ diff --git a/src/main/resources/textures/player/rightOne.png b/src/main/resources/textures/player/rightOne.png new file mode 100644 index 0000000000000000000000000000000000000000..5d26f27d4b44906c9c17e0625329e56407c86d8d Binary files /dev/null and b/src/main/resources/textures/player/rightOne.png differ diff --git a/src/main/resources/textures/player/rightTwo.png b/src/main/resources/textures/player/rightTwo.png new file mode 100644 index 0000000000000000000000000000000000000000..7cf375e6ef6a51ed56f485a03bb5988e21a7ed37 Binary files /dev/null and b/src/main/resources/textures/player/rightTwo.png differ diff --git a/src/main/resources/textures/player/upOne.png b/src/main/resources/textures/player/upOne.png new file mode 100644 index 0000000000000000000000000000000000000000..0e3134b32646f8587e59c68a0c62a9c8697876e1 Binary files /dev/null and b/src/main/resources/textures/player/upOne.png differ diff --git a/src/main/resources/textures/player/upTwo.png b/src/main/resources/textures/player/upTwo.png new file mode 100644 index 0000000000000000000000000000000000000000..2f698853e288792ce6879baa96d7999552fd17fe Binary files /dev/null and b/src/main/resources/textures/player/upTwo.png differ diff --git a/src/main/resources/textures/weapons/SwordDown.png b/src/main/resources/textures/weapons/SwordDown.png new file mode 100644 index 0000000000000000000000000000000000000000..dba0a85781e2e79ac38fc7004e892f7db82e04b5 Binary files /dev/null and b/src/main/resources/textures/weapons/SwordDown.png differ diff --git a/src/main/resources/textures/weapons/SwordLeft.png b/src/main/resources/textures/weapons/SwordLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..f83bcf7fa199d1e4fd97352a9688a78b6a3df757 Binary files /dev/null and b/src/main/resources/textures/weapons/SwordLeft.png differ diff --git a/src/main/resources/textures/weapons/SwordRight.png b/src/main/resources/textures/weapons/SwordRight.png new file mode 100644 index 0000000000000000000000000000000000000000..35bf135d41218bbef6c6409ab4bc99efad373754 Binary files /dev/null and b/src/main/resources/textures/weapons/SwordRight.png differ diff --git a/src/main/resources/textures/weapons/SwordSwingDown.png b/src/main/resources/textures/weapons/SwordSwingDown.png new file mode 100644 index 0000000000000000000000000000000000000000..3d160e5d8d518ca696860cdc77a90b11d2e7aec8 Binary files /dev/null and b/src/main/resources/textures/weapons/SwordSwingDown.png differ diff --git a/src/main/resources/textures/weapons/SwordSwingLeft.png b/src/main/resources/textures/weapons/SwordSwingLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..75dd39ee517e0714684c979e9e5052096fda3eaf Binary files /dev/null and b/src/main/resources/textures/weapons/SwordSwingLeft.png differ diff --git a/src/main/resources/textures/weapons/SwordSwingRight.png b/src/main/resources/textures/weapons/SwordSwingRight.png new file mode 100644 index 0000000000000000000000000000000000000000..a78877e88fdb0b55ffa4b5bb77f036f00f8793c1 Binary files /dev/null and b/src/main/resources/textures/weapons/SwordSwingRight.png differ diff --git a/src/main/resources/textures/weapons/SwordSwingUp.png b/src/main/resources/textures/weapons/SwordSwingUp.png new file mode 100644 index 0000000000000000000000000000000000000000..62ece9f708265ca4b3a9238c8437999825070f71 Binary files /dev/null and b/src/main/resources/textures/weapons/SwordSwingUp.png differ diff --git a/src/main/resources/textures/weapons/SwordUp.png b/src/main/resources/textures/weapons/SwordUp.png new file mode 100644 index 0000000000000000000000000000000000000000..3c6ba9f3c3170669b0e24a4bcda8ebad952f42ca Binary files /dev/null and b/src/main/resources/textures/weapons/SwordUp.png differ