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 dc9b88e85c746bab7c651e5a6baae246eb4b94c4..87c56138e011122792ad57bae2fae5aa55b1fb72 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java @@ -7,8 +7,10 @@ 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; import de.hdm_stuttgart.battlearena.Model.Entity.EntityType; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectStatus; import de.hdm_stuttgart.battlearena.Model.Entity.IEntity; import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; +import de.hdm_stuttgart.battlearena.Model.Map.Biom; import de.hdm_stuttgart.battlearena.Model.Map.TileManager; import javafx.animation.AnimationTimer; @@ -21,7 +23,9 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; import java.net.URL; +import java.util.List; import java.util.ResourceBundle; +import java.util.stream.Collectors; public class GameSceneController implements Initializable { @@ -47,29 +51,51 @@ public class GameSceneController implements Initializable { TileManager tileManager; //map data - String mapString = "4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 " + - "4 1 2 1 1 1 1 2 2 2 1 1 1 1 1 1 1 3 " + - "4 2 1 1 1 1 1 2 2 2 1 1 1 1 2 1 1 3 " + - "4 1 1 1 2 2 4 3 3 1 4 3 3 3 3 2 2 3 " + - "4 1 1 1 2 2 4 1 1 1 1 1 1 1 3 1 2 3 " + - "4 1 1 1 2 2 4 1 3 3 3 1 1 1 3 2 2 3 " + - "4 1 1 1 2 2 4 1 1 1 1 1 1 1 3 2 1 3 " + - "4 1 5 1 2 2 4 3 3 1 4 3 3 3 3 2 1 3 " + - "4 1 1 1 1 1 1 2 2 2 1 1 1 1 1 1 1 3 " + - "4 1 1 1 2 2 4 3 3 1 3 3 3 3 3 2 1 3 " + - "4 1 1 1 1 2 4 3 3 1 3 3 3 3 3 1 1 3 " + - "4 1 1 1 1 2 4 3 3 1 3 3 3 3 3 2 2 3 " + - "4 1 1 1 1 1 4 3 3 1 3 3 3 3 3 1 2 3 " + - "4 1 2 1 1 1 1 2 2 2 1 1 1 1 1 1 1 3 " + - "4 1 1 2 1 1 1 2 2 2 1 1 1 1 1 1 1 3 " + - "4 1 1 1 2 2 4 3 3 1 3 3 3 3 3 2 2 3 " + - "4 1 1 1 2 2 4 3 3 1 3 3 3 3 3 2 2 3 " + - "4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3"; + + /*String mapString = "4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 " + + "4 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 3 " + + "4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 " + + "4 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 3 " + + "4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 " + + "4 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 3 " + + "4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 " + + "4 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 3 " + + "4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 " + + "4 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 3 " + + "4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 " + + "4 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 3 " + + "4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 " + + "4 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 3 " + + "4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 " + + "4 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 3 " + + "4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 " + + "4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 "; + */ + + String mapString = "11 10 13 10 13 10 10 12 14 14 11 10 10 13 10 13 10 12 " + + "11 0 0 0 0 0 16 0 2 2 0 3 0 0 0 3 0 12 " + + "11 0 16 0 0 0 0 0 1 2 0 0 0 0 16 0 1 12 " + + "11 16 0 0 3 0 16 0 2 2 0 0 3 0 0 0 0 12 " + + "11 0 3 0 0 16 0 1 1 2 0 0 0 0 16 0 0 12 " + + "11 0 0 16 16 0 0 0 1 2 0 0 0 0 3 16 0 12 " + + "11 16 0 0 12 10 10 15 12 2 11 15 16 15 15 11 0 12 " + + "11 0 0 0 12 0 1 1 0 2 0 0 0 0 0 11 0 12 " + + "11 0 0 16 12 5 5 5 5 4 5 5 5 5 0 11 1 12 " + + "11 0 0 0 12 11 10 10 10 2 12 0 0 1 0 11 0 12 " + + "11 0 0 0 12 1 0 0 11 2 12 16 0 1 0 11 0 12 " + + "11 0 0 0 12 0 1 0 11 2 12 0 16 0 0 11 0 12 " + + "11 0 1 0 12 0 0 12 11 2 12 11 13 10 13 11 0 12 " + + "11 0 0 0 12 0 0 0 0 2 0 0 0 0 0 0 0 12 " + + "11 0 0 0 12 15 13 10 12 14 11 10 13 10 13 12 0 12 " + + "11 1 0 0 1 0 0 0 0 2 0 0 1 1 0 0 0 12 " + + "11 0 0 1 0 0 1 0 0 2 0 0 1 0 0 1 0 12 " + + "11 10 15 15 10 10 15 10 12 14 11 10 10 15 10 15 10 12"; + int horizontalTileCount = 18; int verticalTileCount = 18; - int diffTileCount = 6; + int diffTileCount = 30; int scaledTileSize = 48; - + private final Biom biom = runtimeInfo.getMapBiom(); @Override public void initialize(URL url, ResourceBundle resourceBundle) { @@ -86,16 +112,19 @@ public class GameSceneController implements Initializable { playerTwoClass, this, PlayerMode.PLAYER_TWO); } - tileManager = new TileManager(graphicsContext2D, diffTileCount, horizontalTileCount, verticalTileCount, mapString); + tileManager = new TileManager(graphicsContext2D, diffTileCount, horizontalTileCount, + verticalTileCount, mapString, biom); runtimeInfo.setGameState(GameState.PLAYING); AnimationTimer gameLoop = new AnimationTimer() { @Override public void handle(long l) { - graphicsContext2D.clearRect(0, 0, canvas2D.getWidth(), canvas2D.getHeight()); - renderContent(graphicsContext2D); - updateContent(); + if (!inputHandler.isPause()) { + graphicsContext2D.clearRect(0, 0, canvas2D.getWidth(), canvas2D.getHeight()); + renderContent(graphicsContext2D); + updateContent(); + } } }; gameLoop.start(); @@ -107,14 +136,33 @@ public class GameSceneController implements Initializable { enemy.updateEntityMovement(this); player.attack(enemy, graphicsContext2D); enemy.attack(player, graphicsContext2D); + updateGameplayObjects(); + player.checkGameplayObjectInteraction(player, graphicsContext2D); + enemy.checkGameplayObjectInteraction(enemy, graphicsContext2D); + player.placeBomb(player, enemy, graphicsContext2D); + enemy.placeBomb(enemy, player, graphicsContext2D); } private void renderContent(GraphicsContext graphicsContext) { tileManager.renderMap(); player.renderEntity(graphicsContext); enemy.renderEntity(graphicsContext); - player.checkHealTile(player, graphicsContext2D); - enemy.checkHealTile(enemy, graphicsContext2D); + renderGameplayObjects(graphicsContext); + } + + private void renderGameplayObjects(GraphicsContext graphicsContext) { + List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects(); + for (IEntity gameplayObject : gameplayObjects) { + gameplayObject.renderEntity(graphicsContext); + } + } + + private void updateGameplayObjects() { + List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects(); + List<IEntity> updateList = gameplayObjects.stream().filter(obj -> obj.getOBJECT_STATUS() != ObjectStatus.USED) + .collect(Collectors.toList()); + runtimeInfo.setGameplayObjects(updateList); + log.debug("Gameplay objects updated"); } public IEntity getEnemy() { @@ -132,4 +180,4 @@ public class GameSceneController implements Initializable { public int getScaledTileSize() { return scaledTileSize; } -} +} \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/RuntimeInfo.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/RuntimeInfo.java index 38ae10a6052607adc5c2279eb8058f1da8107551..ce958a0d96e57d97ddaca65a96f3fc63dcdf70e4 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/RuntimeInfo.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/RuntimeInfo.java @@ -7,9 +7,14 @@ import de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.Exceptions.ParserE import de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.Utilities.HashGenerator; import de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.Utilities.Parser; import de.hdm_stuttgart.battlearena.Model.Entity.EntityClass; +import de.hdm_stuttgart.battlearena.Model.Entity.IEntity; +import de.hdm_stuttgart.battlearena.Model.Map.Biom; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.ArrayList; +import java.util.List; + public class RuntimeInfo { private static final Logger log = LogManager.getLogger(RuntimeInfo.class); @@ -24,6 +29,10 @@ public class RuntimeInfo { private EntityClass playerOneClass = EntityClass.HUMAN; private EntityClass playerTwoClass = EntityClass.HUMAN; + private Biom mapBiom = Biom.GRASS; //Default value: GRASS + + private List<IEntity> gameplayObjects = new ArrayList<>(); + //Stats Tracking during Gameplay private int kills; private int deaths; @@ -32,10 +41,6 @@ public class RuntimeInfo { private boolean gameWon; - - - - private RuntimeInfo(){}; public static RuntimeInfo getInstance(){ @@ -96,6 +101,25 @@ public class RuntimeInfo { this.playerTwoClass = playerTwoClass; } + public Biom getMapBiom() { + return mapBiom; + } + + public void setMapBiom(Biom mapBiom) { + this.mapBiom = mapBiom; + } + + public List<IEntity> getGameplayObjects() { + return gameplayObjects; + } + + public void setGameplayObjects(List<IEntity> gameplayObjects) { + this.gameplayObjects = gameplayObjects; + } + + public int gameTimeInHours(){ + return persistenceInst.getStatistics().getGameTime() / 3600; + public String getMapDataGame() { return mapDataGame; } 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 2e49bcaca57667a7fbea0431ff0fe8c91b356ac5..22ac1a31fc968a838a68df00b1ddad28261b177b 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 @@ -2,6 +2,9 @@ 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.Entity.GameplayObjects.Bomb; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.Heart; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectType; import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; import javafx.scene.canvas.GraphicsContext; @@ -26,4 +29,17 @@ public class EntityFactory { throw new IllegalArgumentException ("Entity type not supported " + entityType); } + public static IEntity createGameplayObject(ObjectType objectType, int cordX, int cordY, GraphicsContext graphicsContext) { + if (objectType == ObjectType.HEART) { + return new Heart(cordX, cordY, graphicsContext); + } else if (objectType == ObjectType.BIG_BOMB) { + return new Bomb(cordX, cordY, graphicsContext); + } else if (objectType == ObjectType.BOMB) { + return new Bomb(cordX, cordY, graphicsContext); + } else if (objectType == ObjectType.EXPLOSION) { + return new Explosion(cordX, cordY, graphicsContext); + } + throw new IllegalArgumentException(); + } + } \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/Explosion.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/Explosion.java new file mode 100644 index 0000000000000000000000000000000000000000..4dc7bc0042e2f9ab9a22f0e32cc388a1baabd747 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/Explosion.java @@ -0,0 +1,119 @@ +package de.hdm_stuttgart.battlearena.Model.Entity; + +import de.hdm_stuttgart.battlearena.Controller.GameSceneController; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectStatus; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectType; +import javafx.geometry.BoundingBox; +import javafx.scene.canvas.GraphicsContext; +import javafx.scene.image.Image; + +import java.util.Objects; + +public class Explosion implements IEntity { + + private final int posX; + private final int posY; + private Image sprite; + private final GraphicsContext graphicsContext; + private BoundingBox boxCollider; + private boolean status; + private final ObjectType OBJECT_TYPE = ObjectType.EXPLOSION; + + private final ObjectStatus OBJECT_STATUS = ObjectStatus.UNUSED; + public Explosion(int posX, int posY, GraphicsContext graphicsContext) { + this.posX = posX; + this.posY = posY; + this.graphicsContext = graphicsContext; + + initializeEntity(); + } + @Override + public void initializeEntity() { + loadEntitySprites(); + boxCollider = new BoundingBox(posX+12, posY+12, 24, 24); + } + @Override + public void loadEntitySprites() { + sprite = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/objects/vfx/smallexplosion.png"))); + } + + @Override + public void updateEntityMovement(GameSceneController gameScene) { + + } + + @Override + public void checkGameplayObjectInteraction(IEntity entity, GraphicsContext graphicsContext) { + + } + + @Override + public void placeBomb(IEntity entity, IEntity entity2, GraphicsContext graphicsContext) { + + } + + @Override + public void attack(IEntity entity, GraphicsContext graphicsContext) { + + } + + @Override + public void updateEntityWalkAnimation() { + + } + + @Override + public void renderEntity(GraphicsContext graphicsContext) { + graphicsContext.drawImage(sprite, posX, posY, 48, 48); + } + + @Override + public void healPlayer(int heal) { + + } + + @Override + public BoundingBox getBoxCollider() { + return boxCollider; + } + + @Override + public EntityDirection getEntityDirection() { + return null; + } + + @Override + public int getEntitySpeed() { + return 0; + } + + @Override + public void gotHit(int damageDone) { + + } + + @Override + public int getMapPosX() { + return posX; + } + + @Override + public int getMapPosY() { + return posY; + } + + public ObjectType getOBJECT_TYPE() { + return OBJECT_TYPE; + } + + @Override + public ObjectStatus getOBJECT_STATUS() { + return OBJECT_STATUS; + } + + @Override + public void setObjectStatus(ObjectStatus objectStatus) { + + } + +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/Bomb.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/Bomb.java new file mode 100644 index 0000000000000000000000000000000000000000..148be0bcf4900af10bf02a825f6947cdc8024ca0 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/Bomb.java @@ -0,0 +1,150 @@ +package de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects; + +import de.hdm_stuttgart.battlearena.Controller.GameSceneController; +import de.hdm_stuttgart.battlearena.Model.Entity.EntityDirection; +import de.hdm_stuttgart.battlearena.Model.Entity.IEntity; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.geometry.BoundingBox; +import javafx.scene.canvas.GraphicsContext; +import javafx.scene.image.Image; +import javafx.util.Duration; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + +import java.util.Objects; + +public class Bomb implements IEntity { + private boolean status; + + private static final Logger log = LogManager.getLogger(Bomb.class); + private final int posX; + private final int posY; + private int frameIndex = 0; + private int frameCounter = 0; + private Image[] frames = new Image[4]; + private final GraphicsContext graphicsContext; + private BoundingBox boxCollider; + private final ObjectType OBJECT_TYPE = ObjectType.BOMB; + private ObjectStatus OBJECT_STATUS = ObjectStatus.UNUSED; + + public Bomb(int posX, int posY, GraphicsContext graphicsContext) { + this.posX = posX; + this.posY = posY; + this.graphicsContext = graphicsContext; + + initializeEntity(); + } + + @Override + public void initializeEntity() { + loadEntitySprites(); + boxCollider = new BoundingBox(posX + 12, posY + 12, 24, 24); + } + + @Override + public void loadEntitySprites() { + frames[0] = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/objects/bomb/bomb.png"))); + frames[1] = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/objects/vfx/bigexplosion.png"))); + frames[2] = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/objects/vfx/middleexplosion.png"))); + frames[3] = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/objects/vfx/smallexplosion.png"))); + } + + @Override + public void updateEntityMovement(GameSceneController gameScene) { + + } + + @Override + public void checkGameplayObjectInteraction(IEntity entity, GraphicsContext graphicsContext) { + + } + + @Override + public void placeBomb(IEntity entity, IEntity entity2, GraphicsContext graphicsContext) { + + } + + @Override + public void attack(IEntity entity, GraphicsContext graphicsContext) { + + } + + @Override + public void updateEntityWalkAnimation() { + + } + + public void renderEntity(GraphicsContext graphicsContext) { + graphicsContext.drawImage(frames[frameIndex], posX, posY, 48, 48); + updateAnimation(); + } + + private void updateAnimation() { + frameCounter++; + + if (frameCounter > 20) { + if (frameIndex == 0) { + frameIndex = 1; + } else if (frameIndex == 1) { + frameIndex = 2; + } else if (frameIndex == 2) { + frameIndex = 3; + } else if (frameIndex == 3) { + OBJECT_STATUS = ObjectStatus.USED; + } + frameCounter = 0; + } + } + + @Override + public void healPlayer(int heal) { + + } + + @Override + public BoundingBox getBoxCollider() { + return boxCollider; + } + + @Override + public EntityDirection getEntityDirection() { + return null; + } + + @Override + public int getEntitySpeed() { + return 0; + } + + @Override + public void gotHit(int damageDone) { + + } + + @Override + public int getMapPosX() { + return posX; + } + + @Override + public int getMapPosY() { + return posY; + } + + @Override + public ObjectType getOBJECT_TYPE() { + return OBJECT_TYPE; + } + + @Override + public ObjectStatus getOBJECT_STATUS() { + return OBJECT_STATUS; + } + + @Override + public void setObjectStatus(ObjectStatus objectStatus) { + OBJECT_STATUS = objectStatus; + } + +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/Heart.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/Heart.java new file mode 100644 index 0000000000000000000000000000000000000000..464e2a93cf37038e6882014231a295783412e242 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/Heart.java @@ -0,0 +1,127 @@ +package de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects; + +import de.hdm_stuttgart.battlearena.Controller.GameSceneController; +import de.hdm_stuttgart.battlearena.Model.Entity.EntityDirection; +import de.hdm_stuttgart.battlearena.Model.Entity.IEntity; + +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; + +import java.util.Objects; + +public class Heart implements IEntity { + + private static final Logger log = LogManager.getLogger(Heart.class); + + private final int posX; + private final int posY; + private Image sprite; + private final GraphicsContext graphicsContext; + private BoundingBox boxCollider; + private final ObjectType OBJECT_TYPE = ObjectType.HEART; + private ObjectStatus OBJECT_STATUS = ObjectStatus.UNUSED; + + public Heart(int posX, int posY, GraphicsContext graphicsContext) { + this.posX = posX; + this.posY = posY; + this.graphicsContext = graphicsContext; + + initializeEntity(); + } + + @Override + public void initializeEntity() { + loadEntitySprites(); + boxCollider = new BoundingBox(posX+12, posY+12, 24, 24); + } + + @Override + public void loadEntitySprites() { + sprite = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/objects/heal/heart.png"))); + } + + @Override + public void updateEntityMovement(GameSceneController gameScene) { + + } + + @Override + public void checkGameplayObjectInteraction(IEntity entity, GraphicsContext graphicsContext) { + + } + + @Override + public void placeBomb(IEntity entity, IEntity entity2, GraphicsContext graphicsContext) { + + } + + @Override + public void attack(IEntity entity, GraphicsContext graphicsContext) { + + } + + @Override + public void updateEntityWalkAnimation() { + + } + + @Override + public void renderEntity(GraphicsContext graphicsContext) { + graphicsContext.drawImage(sprite, posX, posY, 48, 48); + } + + @Override + public void healPlayer(int heal) { + + } + + @Override + public BoundingBox getBoxCollider() { + return boxCollider; + } + + @Override + public EntityDirection getEntityDirection() { + return null; + } + + @Override + public int getEntitySpeed() { + return 0; + } + + @Override + public void gotHit(int damageDone) { + + } + + @Override + public int getMapPosX() { + return posX; + } + + @Override + public int getMapPosY() { + return posY; + } + + @Override + public ObjectType getOBJECT_TYPE() { + return OBJECT_TYPE; + } + + @Override + public ObjectStatus getOBJECT_STATUS() { + return OBJECT_STATUS; + } + + @Override + public void setObjectStatus(ObjectStatus objectStatus) { + OBJECT_STATUS = objectStatus; + } + +} \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/ObjectStatus.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/ObjectStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..265e140799026fb35b7d8c4c241a6646c3de3d06 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/ObjectStatus.java @@ -0,0 +1,6 @@ +package de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects; + +public enum ObjectStatus { + USED, + UNUSED +} \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/ObjectType.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/ObjectType.java new file mode 100644 index 0000000000000000000000000000000000000000..754ba6af47d0fe9b14d2dd364a4aa1692ffb73f5 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Entity/GameplayObjects/ObjectType.java @@ -0,0 +1,8 @@ +package de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects; + +public enum ObjectType { + BIG_BOMB, + BOMB, + HEART, + EXPLOSION +} \ 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 f98ddeb7452f60866c2dfe661dff29162c0004b7..48c41a2feedb132bc619b6f1afb6c92938dc9646 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,37 +1,46 @@ package de.hdm_stuttgart.battlearena.Model.Entity; import de.hdm_stuttgart.battlearena.Controller.GameSceneController; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectStatus; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectType; import javafx.geometry.BoundingBox; import javafx.scene.canvas.GraphicsContext; public interface IEntity { - void initializeEntity(); + void initializeEntity(); - void loadEntitySprites(); + void loadEntitySprites(); - void updateEntityMovement(GameSceneController gameScene); + void updateEntityMovement(GameSceneController gameScene); - void checkHealTile(IEntity entity, GraphicsContext graphicsContext); + //checks collision with GameplayObjects by iterating through GameplayObjects list + void checkGameplayObjectInteraction(IEntity entity, GraphicsContext graphicsContext); - void attack(IEntity entity, GraphicsContext graphicsContext); + void placeBomb(IEntity entity, IEntity entity2, GraphicsContext graphicsContext); - void updateEntityWalkAnimation(); + void attack(IEntity entity, GraphicsContext graphicsContext); - void renderEntity(GraphicsContext graphicsContext); + void updateEntityWalkAnimation(); + + void renderEntity(GraphicsContext graphicsContext); void healPlayer(int heal); BoundingBox getBoxCollider(); - EntityDirection getEntityDirection(); + EntityDirection getEntityDirection(); + + int getEntitySpeed(); - int getEntitySpeed(); + void gotHit(int damageDone); - void gotHit(int damageDone); + int getMapPosX(); - int getMapPosX(); + int getMapPosY(); - int getMapPosY(); + ObjectType getOBJECT_TYPE(); + ObjectStatus getOBJECT_STATUS(); + void setObjectStatus(ObjectStatus objectStatus); } \ No newline at end of file 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 d045a108bf051f2e40573e084199808f2edbc630..ee49d28d3809907eb248e7967e5e12ce6c4afd79 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 @@ -2,6 +2,8 @@ package de.hdm_stuttgart.battlearena.Model.Entity; import de.hdm_stuttgart.battlearena.Controller.GameSceneController; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectStatus; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectType; import javafx.geometry.BoundingBox; import javafx.scene.canvas.GraphicsContext; import javafx.scene.paint.Color; @@ -37,7 +39,12 @@ class NetworkPlayerTwo implements IEntity{ } @Override - public void checkHealTile(IEntity entity, GraphicsContext graphicsContext) { + public void checkGameplayObjectInteraction(IEntity entity, GraphicsContext graphicsContext) { + + } + + @Override + public void placeBomb(IEntity entity, IEntity entity2, GraphicsContext graphicsContext) { } @@ -94,4 +101,19 @@ class NetworkPlayerTwo implements IEntity{ return 0; } + @Override + public ObjectType getOBJECT_TYPE() { + return null; + } + + @Override + public ObjectStatus getOBJECT_STATUS() { + return null; + } + + @Override + public void setObjectStatus(ObjectStatus objectStatus) { + + } + } \ 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 0eaf4b2ca5c23f540e284e5ef6e80bf1be36037f..34e66cdf91673dbda65c9bd92a0f6ac5dddc1298 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 @@ -2,9 +2,13 @@ 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.DataStorage.Classes.RuntimeInfo; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectStatus; +import de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects.ObjectType; import de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler; import de.hdm_stuttgart.battlearena.Model.Map.TileManager; +import javafx.animation.KeyValue; import javafx.geometry.BoundingBox; import javafx.scene.canvas.GraphicsContext; import javafx.scene.image.Image; @@ -12,8 +16,14 @@ import javafx.scene.image.Image; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import java.util.List; import java.util.Objects; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.event.ActionEvent; +import javafx.util.Duration; + class Player implements IEntity { private static final Logger log = LogManager.getLogger(Player.class); @@ -21,6 +31,9 @@ class Player implements IEntity { private final PlayerMode PLAYER_MODE; InputHandler inputHandler; + + RuntimeInfo runtimeInfo = RuntimeInfo.getInstance(); + CollisionHandler collisionHandler = new CollisionHandler(); GraphicsContext gameScene; @@ -61,9 +74,10 @@ class Player implements IEntity { private int playerSpeed; private EntityDirection playerDirection; + private ObjectStatus objectStatus = ObjectStatus.UNUSED; private int health; - private int maxPlayerHealth; + private int maxPlayerHealth; private int damage; public Player(GraphicsContext gameScene, InputHandler inputHandler, EntityClass entityClass, @@ -279,30 +293,115 @@ class Player implements IEntity { boxCollider = new BoundingBox(mapPosX + 15, mapPosY + 10, playerWidth, playerHeight); } + + @Override + public void checkGameplayObjectInteraction(IEntity entity, GraphicsContext graphicsContext) { + + List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects(); + for (IEntity gameplayObject : gameplayObjects) { + if (gameplayObject.getOBJECT_TYPE() == ObjectType.HEART) { + if (gameplayObject.getBoxCollider().intersects(boxCollider)) { + log.info("Collision with heart"); + healPlayer(5); + gameplayObject.setObjectStatus(ObjectStatus.USED); + } + } else if (gameplayObject.getOBJECT_TYPE() == ObjectType.BOMB) { + if (gameplayObject.getBoxCollider().intersects(boxCollider)) { + log.info("Collision with bomb"); + gotHit(10); + } + } else if (gameplayObject.getOBJECT_TYPE() == ObjectType.EXPLOSION) { + if (gameplayObject.getBoxCollider().intersects(boxCollider)) { + log.info("Collision with explosion"); + gotHit(10); + } + } + } + } + @Override - public void checkHealTile(IEntity entity, GraphicsContext graphicsContext){ + public void placeBomb(IEntity entity, IEntity entity2, GraphicsContext graphicsContext) { + + if (inputHandler.isBomb() && PLAYER_MODE == PlayerMode.PLAYER_ONE || + inputHandler.isSdBomb() && PLAYER_MODE == PlayerMode.PLAYER_TWO) { + int spawnCordX = mapPosX + 12; + int spawnCordY = mapPosY + 12; + + List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects(); + IEntity bomb = EntityFactory.createGameplayObject(ObjectType.BOMB, spawnCordX, spawnCordY, graphicsContext); + gameplayObjects.add(bomb); + runtimeInfo.setGameplayObjects(gameplayObjects); + log.info("bomb placed"); + } + } + + public void checkChangeTiles(IEntity entity) { + boolean isDestructible; int xTile = entity.getMapPosX() / gameSceneController.getScaledTileSize(); int yTile = entity.getMapPosY() / gameSceneController.getScaledTileSize(); - if(TileManager.tileMap[yTile][xTile +1 ] == 5){ - entity.healPlayer(1); - TileManager.tileMap[yTile][xTile +1] = 2; - log.info("Healed +1: " + health); + isDestructible = checkTileNon_Destructible(yTile, xTile); + if (isDestructible) { + TileManager.tileMap[yTile][xTile] = 7; + for (int i = 0; i < 3; i++) { + isDestructible = checkTileNon_Destructible(yTile + 1 + i, xTile); //If Tile solid , -> should stop comparing, + if (isDestructible && (yTile < 18 && xTile < 18)) { //because for now, Tile behind gets destroyed aswell + TileManager.tileMap[yTile + 1 + i][xTile] = 8; + /*if(entity || entity2) { + entity2.gotHit(2); //See if enemy or player hit + }*/ + } + isDestructible = checkTileNon_Destructible(yTile - 1 - i, xTile); + if (isDestructible && (yTile < 18 && xTile < 18 && yTile > 0 && xTile > 0)) { + TileManager.tileMap[yTile - 1 - i][xTile] = 8; + entity.gotHit(2); + } + isDestructible = checkTileNon_Destructible(yTile, xTile + 1 + i); + if (isDestructible && (yTile < 18 && xTile < 18 && yTile > 0 && xTile > 0)) { + TileManager.tileMap[yTile][xTile + 1 + i] = 8; + entity.gotHit(2); + } + isDestructible = checkTileNon_Destructible(yTile, xTile - 1 - i); + if (isDestructible && (yTile < 18 && xTile < 18 && yTile > 0 && xTile > 0)) { + TileManager.tileMap[yTile][xTile - 1 - i] = 8; + entity.gotHit(2); + } + } } } + /*isDestructible = checkTileNon_Destructible(yTile, xTile); //for loop + if(isDestructible){ + TileManager.tileMap[yTile][xTile] = 7; + isDestructible = checkTileNon_Destructible(yTile-1, xTile); //for loop + }else if(isDestructible) + TileManager.tileMap[yTile-1][xTile] = 8; + TileManager.tileMap[yTile-2][xTile] = 8; //Change it with a DestructionHandler like CollisionHandler + TileManager.tileMap[yTile+1][xTile] = 8; + TileManager.tileMap[yTile+2][xTile] = 8; //Why doesnt it work like in CollisionHandler with tileSet + TileManager.tileMap[yTile][xTile+1] = 8; + TileManager.tileMap[yTile][xTile+2] = 8; + TileManager.tileMap[yTile][xTile-1] = 8; + TileManager.tileMap[yTile][xTile-2] = 8;*/ + //} + //} + + public boolean checkTileNon_Destructible(int y, int x) { //Change it with a DestructionHandler like CollisionHandler + //tileSet[xTile].getDestruction(); + if (TileManager.tileMap[y][x] != 10 && TileManager.tileMap[y][x] != 3 && TileManager.tileMap[y][x] != 4) { + return true; + } + return false; + } + @Override public void attack(IEntity entity, GraphicsContext graphicsContext) { BoundingBox hitBox; int xTile = mapPosX / gameSceneController.getScaledTileSize(); int yTile = mapPosY / gameSceneController.getScaledTileSize(); - //log.info(xTile); - //log.info(yTile); - //int xTile = (int) (Math.random() * (18 - 1)); //Get xTile Coordinate +1 /-1 of playerTile - //int yTile = (int) (Math.random() * (18 - 1)); //Get yTile Coordinate +1 /-1 of playerTile + double dropChance = 0.5; double randomDropChance = Math.random() * 1; - //log.info(randomDropChance); //Added and subtracted numbers from variables are the pixel insets of the player sprite @@ -315,62 +414,45 @@ class Player implements IEntity { 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); - - if (((TileManager.tileMap[xTile][yTile] == 3) && randomDropChance > dropChance)|| - ((TileManager.tileMap[xTile][yTile] == 1) && randomDropChance > dropChance)) - TileManager.tileMap[yTile-1][xTile+1] = 5; - //TileManager.tileMap[yTile-2][xTile] = 5; - //TileManager.tileMap[yTile-3][xTile] = 5; - } + hitEnemy(entity, graphicsContext, hitBox, dropChance, randomDropChance); } 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())) { - entity.gotHit(damage); - graphicsContext.strokeText("Hit", 10, 10); - - if (((TileManager.tileMap[xTile][yTile] == 3) && randomDropChance > dropChance)|| - ((TileManager.tileMap[xTile][yTile] == 1) && randomDropChance > dropChance)) - TileManager.tileMap[yTile-1][xTile+1] = 5; - //TileManager.tileMap[yTile-2][xTile] = 5; - //TileManager.tileMap[yTile-3][xTile] = 5; - } + hitEnemy(entity, graphicsContext, hitBox, dropChance, randomDropChance); } 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())) { - entity.gotHit(damage); - graphicsContext.strokeText("Hit", 10, 10); - - if (((TileManager.tileMap[xTile][yTile] == 3) && randomDropChance > dropChance)|| - ((TileManager.tileMap[xTile][yTile] == 1) && randomDropChance > dropChance)) - TileManager.tileMap[yTile-1][xTile+1] = 5; - //TileManager.tileMap[yTile-2][xTile] = 5; - //TileManager.tileMap[yTile-3][xTile] = 5; - } + hitEnemy(entity, graphicsContext, hitBox, dropChance, randomDropChance); } 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())) { - entity.gotHit(damage); - graphicsContext.strokeText("Hit", 10, 10); - - if (((TileManager.tileMap[xTile][yTile] == 3) && randomDropChance > dropChance)|| - ((TileManager.tileMap[xTile][yTile] == 1) && randomDropChance > dropChance)) - TileManager.tileMap[yTile-1][xTile+1] = 5; - //TileManager.tileMap[yTile-2][xTile] = 5; - //TileManager.tileMap[yTile-3][xTile] = 5; - } + hitEnemy(entity, graphicsContext, hitBox, dropChance, randomDropChance); + } + } + } + + private void hitEnemy(IEntity entity, GraphicsContext graphicsContext, BoundingBox hitBox, double dropChance, double randomDropChance) { + if (hitBox.intersects(entity.getBoxCollider())) { + entity.gotHit(damage); + log.info("Hit enemy"); + + //spawning heart entity + if (randomDropChance > dropChance) { + int spawnCordX = mapPosX + 48; + int spawnCordY = mapPosY + 48; + + List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects(); + IEntity heart = EntityFactory.createGameplayObject(ObjectType.HEART, spawnCordX, spawnCordY, graphicsContext); + gameplayObjects.add(heart); + runtimeInfo.setGameplayObjects(gameplayObjects); + log.info("heart dropped"); } } } @@ -438,6 +520,7 @@ class Player implements IEntity { public void gotHit(int damageDone) { health -= damageDone; } + @Override public void healPlayer(int healthRegenerated) { int regeneratedHealth = health + healthRegenerated; @@ -475,4 +558,19 @@ class Player implements IEntity { return mapPosY; } + @Override + public ObjectType getOBJECT_TYPE() { + return null; + } + + @Override + public ObjectStatus getOBJECT_STATUS() { + return null; + } + + @Override + public void setObjectStatus(ObjectStatus objectStatus) { + + } + } \ 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 a66f47e852aac620010f786bbff62a0700292535..619475fd0efe408e8a82d4a020a599f6fb87a6c5 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,36 +18,47 @@ public class InputHandler { return inputHandler; } - //Local Player/Player one controls - private boolean moveUp, moveDown, moveLeft, moveRight, attack; + //general input + private boolean isPause = false; + + //Local + Network Player one controls + private boolean moveUp, moveDown, moveLeft, moveRight, attack, bomb; //Local player two controls - private boolean sdMoveUp, sdMoveDown, sdMoveLeft, sdMoveRight, sdAttack; + private boolean sdMoveUp, sdMoveDown, sdMoveLeft, sdMoveRight, sdAttack, sdBomb; public void handleKeyPress(KeyEvent event) { KeyCode code = event.getCode(); switch (code) { + case ESCAPE: + isPause = !isPause; + log.debug("Pause button pressed"); + break; case W: moveUp = true; - log.debug("Player move up"); + log.debug("Player one move up"); break; case S: moveDown = true; - log.debug("Player move down"); + log.debug("Player one move down"); break; case A: moveLeft = true; - log.debug("Player move left"); + log.debug("Player one move left"); break; case D: moveRight = true; - log.debug("Player move right"); + log.debug("Player one move right"); break; case E: attack = true; - log.debug("Player attack"); + log.debug("Player one attack"); + break; + case Q: + bomb = true; break; + //inputs for second player case UP: sdMoveUp = true; break; @@ -63,6 +74,9 @@ public class InputHandler { case MINUS: sdAttack = true; break; + case CONTROL: + sdBomb = true; + break; } } @@ -85,6 +99,10 @@ public class InputHandler { case E: attack = false; break; + case Q: + bomb = false; + break; + //inputs for second player case UP: sdMoveUp = false; break; @@ -100,9 +118,16 @@ public class InputHandler { case MINUS: sdAttack = false; break; + case CONTROL: + sdBomb = false; + break; } } + public boolean isPause() { + return isPause; + } + public boolean isMoveUp() { return moveUp; } @@ -142,4 +167,12 @@ public class InputHandler { public boolean isSdAttack() { return sdAttack; } + + public boolean isBomb(){ + return bomb; + } + + public boolean isSdBomb(){ + return sdBomb; + } } \ No newline at end of file diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/Biom.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/Biom.java new file mode 100644 index 0000000000000000000000000000000000000000..ee6ca402f3fc3ec6bd1219c6a335578386e166b1 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/Biom.java @@ -0,0 +1,8 @@ +package de.hdm_stuttgart.battlearena.Model.Map; + +public enum Biom { + BOMBERMAN, + DARK_LANDS, + FORREST, + GRASS +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactory.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactory.java index 0da1a1558d0e6888a73fa456d3dd81f021d936fc..24dc7d78e70a57b79370cf76275ac591e44d0332 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactory.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactory.java @@ -9,18 +9,18 @@ public class TileFactory { private static final Logger log = LogManager.getLogger(TileFactory.class); - public static ITile createTile(TileType tileType, TileType tileType2, Image tileSprite) { - if (tileType == TileType.WALKABLE && tileType2 == TileType.DESTRUCTIBLE) { - log.info("Tile with type: " + tileType + " " + tileType2 + " created."); + public static ITile createTile(TileType tileType, TileType destructible, Image tileSprite) { + if (tileType == TileType.WALKABLE && destructible == TileType.DESTRUCTIBLE) { + log.info("Tile with type: " + tileType + " " + destructible + " created."); return new BackgroundTile(tileSprite, true, true); - }else if (tileType == TileType.WALKABLE && tileType2 == TileType.NON_DESTRUCTIBLE) { - log.info("Tile with type: " + tileType + " " + tileType2 +" created."); + }else if (tileType == TileType.WALKABLE && destructible == TileType.NON_DESTRUCTIBLE) { + log.info("Tile with type: " + tileType + " " + destructible +" created."); return new BackgroundTile(tileSprite, true, false); - }else if (tileType == TileType.NON_WALKABLE && tileType2 == TileType.DESTRUCTIBLE) { - log.info("Tile with type: " + tileType + " " + tileType2 +" created."); + }else if (tileType == TileType.NON_WALKABLE && destructible == TileType.DESTRUCTIBLE) { + log.info("Tile with type: " + tileType + " " + destructible +" created."); return new BackgroundTile(tileSprite, false, true); - }else if (tileType == TileType.NON_WALKABLE && tileType2 == TileType.NON_DESTRUCTIBLE) { - log.info("Tile with type: " + tileType + " " + tileType2 +" created."); + }else if (tileType == TileType.NON_WALKABLE && destructible == TileType.NON_DESTRUCTIBLE) { + log.info("Tile with type: " + tileType + " " + destructible +" created."); return new BackgroundTile(tileSprite, false, false); } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileManager.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileManager.java index 0ac687dab223e1933fe99bbf42db3dfd3ed8b8b5..960cb25be0d17bd4e46fba3b7318f6636a254c71 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileManager.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileManager.java @@ -20,7 +20,7 @@ public class TileManager { private final int verticalTileCount; public TileManager(GraphicsContext graphicsContext2D, int diffTileCount, - int horizontalTileCount, int verticalTileCount, String mapString) { + int horizontalTileCount, int verticalTileCount, String mapString, Biom biom) { this.graphicsContext2D = graphicsContext2D; this.horizontalTileCount = horizontalTileCount; this.verticalTileCount = verticalTileCount; @@ -28,26 +28,284 @@ public class TileManager { tileSet = new BackgroundTile[diffTileCount]; tileMap = new int[horizontalTileCount][verticalTileCount]; - createTiles(); + createTiles(biom); generateMap(mapString, horizontalTileCount, verticalTileCount); } - private void createTiles() { - try { - tileSet[0] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, - new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/Grass01.png")))); - tileSet[1] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, - new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/Grass02.png")))); - tileSet[2] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, - new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/Grass04.png")))); - tileSet[3] = TileFactory.createTile(TileType.NON_WALKABLE, TileType.DESTRUCTIBLE, - new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/Stone01.png")))); - tileSet[4] = TileFactory.createTile(TileType.NON_WALKABLE, TileType.DESTRUCTIBLE, - new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/Stone02.png")))); - tileSet[5] = TileFactory.createTile(TileType.WALKABLE,TileType.NON_DESTRUCTIBLE, - new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/finalheart.png")))); + //index 0-9: WALKABLE + NON_DESTRUCTIBLE, index 10-19: NON_WALKABLE + NON_DESTRUCTIBLE, index 20-29: DESTRUCTIBLE + private void createTiles(Biom biom) { + if (biom == Biom.GRASS) { + try { + //Textures of walkable tiles + tileSet[0] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/ground/GrassGrassLand00.png")))); + tileSet[1] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/ground/GrassGrassLand01.png")))); + tileSet[2] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/ground/GrassPathGrassLand02.png")))); + tileSet[3] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/ground/GrassGrassLand03.png")))); + tileSet[4] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[5] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[6] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[7] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[8] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[9] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + //Textures of solid tiles + non destructible + tileSet[10] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/building/StoneGrassLand00.png")))); + tileSet[11] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/building/StoneEndLeftGrassLand01.png")))); + tileSet[12] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/building/StoneEndRightGrassLand02.png")))); + tileSet[13] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/building/StoneWindowGrassLand03.png")))); + tileSet[14] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/building/StoneGateGrassLand04.png")))); + tileSet[15] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/building/StoneGrassLand05.png")))); + tileSet[16] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/grass_biom/ground/GrassGrassLand04.png")))); + tileSet[17] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[18] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[19] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + //Testures of destructible tiles + tileSet[20] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[21] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[22] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[23] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[24] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[25] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[26] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[27] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[28] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[29] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + } catch (Exception e) { + log.error(e); + } + }else if(biom == Biom.DARK_LANDS){ + try { + //Textures of walkable tiles + tileSet[0] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/ground/GrassDarkLand00.png")))); + tileSet[1] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/ground/GrassDarkLand01.png")))); + tileSet[2] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/ground/GrassPathDarkLand02.png")))); + tileSet[3] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/ground/GrassDarkLand03.png")))); + tileSet[4] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[5] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[6] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[7] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[8] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[9] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + //Textures of solid tiles + tileSet[10] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/building/StoneDarkLand00.png")))); + tileSet[11] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/building/StoneEndLeftDarkLand01.png")))); + tileSet[12] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/building/StoneEndRightDarkLand02.png")))); + tileSet[13] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/building/StoneWindowDarkLand03.png")))); + tileSet[14] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/building/StoneGateDarkLand04.png")))); + tileSet[15] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/building/NoTexture.png")))); + tileSet[16] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/dark_lands_biom/ground/NoTexture.png")))); + tileSet[17] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[18] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[19] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + //Testures of destructible tiles + tileSet[20] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[21] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[22] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[23] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[24] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[25] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[26] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[27] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[28] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[29] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); } catch (Exception e) { - log.error(e); + log.error(e); + } + }else if(biom == Biom.BOMBERMAN){ + try { + //Textures of walkable tiles + tileSet[0] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/bomberman/ground/GrassBombLand00.png")))); + tileSet[1] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/bomberman/ground/GrassBombLand01.png")))); + tileSet[2] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[3] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/bomberman/ground/GrassBombLand03.png")))); + tileSet[4] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/bomberman/ground/GrassBombLand04.png")))); + tileSet[5] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[6] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[7] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[8] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[9] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + //Textures of solid tiles + tileSet[10] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/bomberman/building/StoneBombLand00.png")))); + tileSet[11] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/bomberman/building/StoneBombLand01.png")))); + tileSet[12] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[13] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[14] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[15] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[16] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[17] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[18] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[19] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + //Testures of destructible tiles + tileSet[20] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/bomberman/building/box.png")))); + tileSet[21] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[22] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[23] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[24] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[25] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[26] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[27] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[28] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[29] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + } catch (Exception e) { + log.error(e); + } + }else if(biom == Biom.FORREST){ + try { + //Textures of walkable tiles + tileSet[0] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/forrest_biom/ground/GrassWoodLand00.png")))); + tileSet[1] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/forrest_biom/ground/GrassWoodLand01.png")))); + tileSet[2] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/forrest_biom/ground/GrassPathWoodLand02.png")))); + tileSet[3] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/forrest_biom/ground/GrassWoodLand03.png")))); + tileSet[4] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[5] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[6] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[7] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[8] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[9] = TileFactory.createTile(TileType.WALKABLE, TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + //Textures of solid tiles + tileSet[10] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[11] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[12] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[13] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[14] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[15] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[16] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[17] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[18] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[19] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + //Testures of destructible tiles + tileSet[20] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[21] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[22] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[23] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[24] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[25] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[26] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[27] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[28] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + tileSet[29] = TileFactory.createTile(TileType.NON_WALKABLE,TileType.NON_DESTRUCTIBLE, + new Image(Objects.requireNonNull(getClass().getResourceAsStream("/textures/map/NoTexture.png")))); + } catch (Exception e) { + log.error(e); + } } } diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index f0029279f9b345c8bca30dd1ea57552d991b6c83..cfa911fde77840d173e9615d57c9722435c60377 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -24,4 +24,7 @@ module gui { exports de.hdm_stuttgart.battlearena.Model.Inputs; exports de.hdm_stuttgart.battlearena.Model.Map; exports de.hdm_stuttgart.battlearena.Controller.Utilities; -} + exports de.hdm_stuttgart.battlearena.Model.Multiplayer; + exports de.hdm_stuttgart.battlearena.Model.Entity.GameplayObjects to javafx.fxml; + opens de.hdm_stuttgart.battlearena.Controller.Utilities to javafx.fxml; +} \ No newline at end of file diff --git a/src/main/resources/textures/map/NoTexture.png b/src/main/resources/textures/map/NoTexture.png new file mode 100644 index 0000000000000000000000000000000000000000..97d81e90559b742fa2098131248ce24bc7675069 Binary files /dev/null and b/src/main/resources/textures/map/NoTexture.png differ diff --git a/src/main/resources/textures/map/bomberman/building/StoneBombLand00.png b/src/main/resources/textures/map/bomberman/building/StoneBombLand00.png new file mode 100644 index 0000000000000000000000000000000000000000..46ca4543d42aa78de8ce196efc7df1142b9e45b2 Binary files /dev/null and b/src/main/resources/textures/map/bomberman/building/StoneBombLand00.png differ diff --git a/src/main/resources/textures/map/bomberman/building/StoneBombLand01.png b/src/main/resources/textures/map/bomberman/building/StoneBombLand01.png new file mode 100644 index 0000000000000000000000000000000000000000..1c61f1fafb63ae962d0ebfe751c57bce38409eb4 Binary files /dev/null and b/src/main/resources/textures/map/bomberman/building/StoneBombLand01.png differ diff --git a/src/main/resources/textures/map/bomberman/building/box.png b/src/main/resources/textures/map/bomberman/building/box.png new file mode 100644 index 0000000000000000000000000000000000000000..6c6cf965c67c4e8008c453bd87f27542d9ebe8a2 Binary files /dev/null and b/src/main/resources/textures/map/bomberman/building/box.png differ diff --git a/src/main/resources/textures/map/bomberman/ground/GrassBombLand00.png b/src/main/resources/textures/map/bomberman/ground/GrassBombLand00.png new file mode 100644 index 0000000000000000000000000000000000000000..df8c715b668007d41adc80069353521fbf6c6549 Binary files /dev/null and b/src/main/resources/textures/map/bomberman/ground/GrassBombLand00.png differ diff --git a/src/main/resources/textures/map/bomberman/ground/GrassBombLand01.png b/src/main/resources/textures/map/bomberman/ground/GrassBombLand01.png new file mode 100644 index 0000000000000000000000000000000000000000..0ea16c187324435fb1b410ffb1fbe221474f210e Binary files /dev/null and b/src/main/resources/textures/map/bomberman/ground/GrassBombLand01.png differ diff --git a/src/main/resources/textures/map/bomberman/ground/GrassBombLand03.png b/src/main/resources/textures/map/bomberman/ground/GrassBombLand03.png new file mode 100644 index 0000000000000000000000000000000000000000..235ee9314e9402c61ef3400096abde0a07ea8e39 Binary files /dev/null and b/src/main/resources/textures/map/bomberman/ground/GrassBombLand03.png differ diff --git a/src/main/resources/textures/map/bomberman/ground/GrassBombLand04.png b/src/main/resources/textures/map/bomberman/ground/GrassBombLand04.png new file mode 100644 index 0000000000000000000000000000000000000000..9985b27f06a1b46b4ae4f8eba609fd927d7bf09e Binary files /dev/null and b/src/main/resources/textures/map/bomberman/ground/GrassBombLand04.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/building/StoneDarkLand00.png b/src/main/resources/textures/map/dark_lands_biom/building/StoneDarkLand00.png new file mode 100644 index 0000000000000000000000000000000000000000..7141744f6029a09af2e65b7af0f5f766042ca75b Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/building/StoneDarkLand00.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/building/StoneEndLeftDarkLand01.png b/src/main/resources/textures/map/dark_lands_biom/building/StoneEndLeftDarkLand01.png new file mode 100644 index 0000000000000000000000000000000000000000..b71227d4148111cc979cfa08e68deac7236530b2 Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/building/StoneEndLeftDarkLand01.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/building/StoneEndRightDarkLand02.png b/src/main/resources/textures/map/dark_lands_biom/building/StoneEndRightDarkLand02.png new file mode 100644 index 0000000000000000000000000000000000000000..7dfab3fb95f3017893cc077b665dfc96a4736bda Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/building/StoneEndRightDarkLand02.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/building/StoneGateDarkLand04.png b/src/main/resources/textures/map/dark_lands_biom/building/StoneGateDarkLand04.png new file mode 100644 index 0000000000000000000000000000000000000000..ee9984315fc1f60ff9606ea8c2ca1fd89005887e Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/building/StoneGateDarkLand04.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/building/StoneWindowDarkLand03.png b/src/main/resources/textures/map/dark_lands_biom/building/StoneWindowDarkLand03.png new file mode 100644 index 0000000000000000000000000000000000000000..ca334756581f2cc2a55fbacc90f76d9b264b3bec Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/building/StoneWindowDarkLand03.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand00.png b/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand00.png new file mode 100644 index 0000000000000000000000000000000000000000..1d2c1ca9eaab73d2d221f59f1264e68f1ab354b7 Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand00.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand01.png b/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand01.png new file mode 100644 index 0000000000000000000000000000000000000000..2699381fb84e425ae3b20b119ed4b12a5cfc4d71 Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand01.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand03.png b/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand03.png new file mode 100644 index 0000000000000000000000000000000000000000..ff59e764b05b97b000573b245368329779b96823 Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/ground/GrassDarkLand03.png differ diff --git a/src/main/resources/textures/map/dark_lands_biom/ground/GrassPathDarkLand02.png b/src/main/resources/textures/map/dark_lands_biom/ground/GrassPathDarkLand02.png new file mode 100644 index 0000000000000000000000000000000000000000..75b3a83c783fcb392b405d5c42879db3dfecc72c Binary files /dev/null and b/src/main/resources/textures/map/dark_lands_biom/ground/GrassPathDarkLand02.png differ diff --git a/src/main/resources/textures/map/finalheart.png b/src/main/resources/textures/map/finalheart.png deleted file mode 100644 index b861b145ceb949abdd7222a2679fe8e10756340f..0000000000000000000000000000000000000000 Binary files a/src/main/resources/textures/map/finalheart.png and /dev/null differ diff --git a/src/main/resources/textures/map/forrest_biom/ground/GrassPathWoodLand02.png b/src/main/resources/textures/map/forrest_biom/ground/GrassPathWoodLand02.png new file mode 100644 index 0000000000000000000000000000000000000000..ff9e2ae306770e15731903d53865bc382703e9d6 Binary files /dev/null and b/src/main/resources/textures/map/forrest_biom/ground/GrassPathWoodLand02.png differ diff --git a/src/main/resources/textures/map/Grass01.png b/src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand00.png similarity index 84% rename from src/main/resources/textures/map/Grass01.png rename to src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand00.png index e835d4676d2f80105626ece4d99b485a30b289fe..48584467f86445ad1f78925eb9f9cf219d1a46c4 100644 Binary files a/src/main/resources/textures/map/Grass01.png and b/src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand00.png differ diff --git a/src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand01.png b/src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand01.png new file mode 100644 index 0000000000000000000000000000000000000000..5d13544cd45bf4968df0444b75d688e198ceb805 Binary files /dev/null and b/src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand01.png differ diff --git a/src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand03.png b/src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand03.png new file mode 100644 index 0000000000000000000000000000000000000000..aae4f73a84f5c03f1e448110853ccb0e5e3d6680 Binary files /dev/null and b/src/main/resources/textures/map/forrest_biom/ground/GrassWoodLand03.png differ diff --git a/src/main/resources/textures/map/Stone02.png b/src/main/resources/textures/map/grass_biom/building/StoneEndLeftGrassLand01.png similarity index 85% rename from src/main/resources/textures/map/Stone02.png rename to src/main/resources/textures/map/grass_biom/building/StoneEndLeftGrassLand01.png index 2ac41bee77062960aa2d8cfc921f66e45de629ba..afc98f647c69ff41538c540ad5f81dbddc9df2fd 100644 Binary files a/src/main/resources/textures/map/Stone02.png and b/src/main/resources/textures/map/grass_biom/building/StoneEndLeftGrassLand01.png differ diff --git a/src/main/resources/textures/map/grass_biom/building/StoneEndRightGrassLand02.png b/src/main/resources/textures/map/grass_biom/building/StoneEndRightGrassLand02.png new file mode 100644 index 0000000000000000000000000000000000000000..41fdeb5b6fb3096837434f98e0b779ec548779d2 Binary files /dev/null and b/src/main/resources/textures/map/grass_biom/building/StoneEndRightGrassLand02.png differ diff --git a/src/main/resources/textures/map/grass_biom/building/StoneGateGrassLand04.png b/src/main/resources/textures/map/grass_biom/building/StoneGateGrassLand04.png new file mode 100644 index 0000000000000000000000000000000000000000..ee4e9538c461e7cd81843211bedfa1459863f098 Binary files /dev/null and b/src/main/resources/textures/map/grass_biom/building/StoneGateGrassLand04.png differ diff --git a/src/main/resources/textures/map/Stone01.png b/src/main/resources/textures/map/grass_biom/building/StoneGrassLand00.png similarity index 85% rename from src/main/resources/textures/map/Stone01.png rename to src/main/resources/textures/map/grass_biom/building/StoneGrassLand00.png index b6cf13f66633060803264739b889f64c32877a0e..e31b2ac22af757240fd1a2d1fdf155161886866f 100644 Binary files a/src/main/resources/textures/map/Stone01.png and b/src/main/resources/textures/map/grass_biom/building/StoneGrassLand00.png differ diff --git a/src/main/resources/textures/map/grass_biom/building/StoneGrassLand05.png b/src/main/resources/textures/map/grass_biom/building/StoneGrassLand05.png new file mode 100644 index 0000000000000000000000000000000000000000..1c93eef9343e85ccaf5f27ee57acf8af255530cd Binary files /dev/null and b/src/main/resources/textures/map/grass_biom/building/StoneGrassLand05.png differ diff --git a/src/main/resources/textures/map/grass_biom/building/StoneWindowGrassLand03.png b/src/main/resources/textures/map/grass_biom/building/StoneWindowGrassLand03.png new file mode 100644 index 0000000000000000000000000000000000000000..ae7119eeb0a21560093f3dc8fcb52a33bdb40708 Binary files /dev/null and b/src/main/resources/textures/map/grass_biom/building/StoneWindowGrassLand03.png differ diff --git a/src/main/resources/textures/map/Grass02.png b/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand00.png similarity index 84% rename from src/main/resources/textures/map/Grass02.png rename to src/main/resources/textures/map/grass_biom/ground/GrassGrassLand00.png index 144fad81f75b681454b58768081394cb40aaeead..42f20fb577ca233a64f9e570ca2c448a125ce2cd 100644 Binary files a/src/main/resources/textures/map/Grass02.png and b/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand00.png differ diff --git a/src/main/resources/textures/map/Grass04.png b/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand01.png similarity index 63% rename from src/main/resources/textures/map/Grass04.png rename to src/main/resources/textures/map/grass_biom/ground/GrassGrassLand01.png index 4ce012b5eac6c41488efe96c5f66eb43c28c98ce..c0f799dfc6e5857b5cefa31c3b3732d4f1a84770 100644 Binary files a/src/main/resources/textures/map/Grass04.png and b/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand01.png differ diff --git a/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand03.png b/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand03.png new file mode 100644 index 0000000000000000000000000000000000000000..abdfbc8114e9e5a233757bf77a764fc1e753365b Binary files /dev/null and b/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand03.png differ diff --git a/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand04.png b/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand04.png new file mode 100644 index 0000000000000000000000000000000000000000..2ea95c178f078c9adceba8de2a8d1af544200ca5 Binary files /dev/null and b/src/main/resources/textures/map/grass_biom/ground/GrassGrassLand04.png differ diff --git a/src/main/resources/textures/map/grass_biom/ground/GrassPathGrassLand02.png b/src/main/resources/textures/map/grass_biom/ground/GrassPathGrassLand02.png new file mode 100644 index 0000000000000000000000000000000000000000..7a8050dfd2e9188c0c72d7000ae205c55864e6d8 Binary files /dev/null and b/src/main/resources/textures/map/grass_biom/ground/GrassPathGrassLand02.png differ diff --git a/src/main/resources/textures/objects/big_bomb/bigbomb.png b/src/main/resources/textures/objects/big_bomb/bigbomb.png new file mode 100644 index 0000000000000000000000000000000000000000..27a153a8731d525576a01437499f4ade60b4d5fe Binary files /dev/null and b/src/main/resources/textures/objects/big_bomb/bigbomb.png differ diff --git a/src/main/resources/textures/objects/bomb/bomb.png b/src/main/resources/textures/objects/bomb/bomb.png new file mode 100644 index 0000000000000000000000000000000000000000..6f29b3f6124a917afe8492f2e318d15dd93ff7c7 Binary files /dev/null and b/src/main/resources/textures/objects/bomb/bomb.png differ diff --git a/src/main/resources/textures/objects/heal/heart.png b/src/main/resources/textures/objects/heal/heart.png new file mode 100644 index 0000000000000000000000000000000000000000..2eea9b2c91b68cb55d98fad6118da284e9d874a4 Binary files /dev/null and b/src/main/resources/textures/objects/heal/heart.png differ diff --git a/src/main/resources/textures/objects/vfx/bigexplosion.png b/src/main/resources/textures/objects/vfx/bigexplosion.png new file mode 100644 index 0000000000000000000000000000000000000000..f1e10d9d22cc8e0147dc55f8a9c6e2125f75bfd5 Binary files /dev/null and b/src/main/resources/textures/objects/vfx/bigexplosion.png differ diff --git a/src/main/resources/textures/objects/vfx/middleexplosion.png b/src/main/resources/textures/objects/vfx/middleexplosion.png new file mode 100644 index 0000000000000000000000000000000000000000..7639e02887afa6a80408de549113441b504b1a5a Binary files /dev/null and b/src/main/resources/textures/objects/vfx/middleexplosion.png differ diff --git a/src/main/resources/textures/objects/vfx/smallexplosion.png b/src/main/resources/textures/objects/vfx/smallexplosion.png new file mode 100644 index 0000000000000000000000000000000000000000..7639e02887afa6a80408de549113441b504b1a5a Binary files /dev/null and b/src/main/resources/textures/objects/vfx/smallexplosion.png differ