Skip to content
Snippets Groups Projects
Commit 8cf4731f authored by Schlütter Yannik's avatar Schlütter Yannik
Browse files

Better arrangement of methods, removing of redundant code

parent 22767e56
No related branches found
No related tags found
4 merge requests!74V1,!73Initial commit,!71Merge DataBase into Development,!33Update: Items, spawn locations of items, hit rate, i-frames
......@@ -327,20 +327,11 @@ class Player implements IEntity {
gameplayObjects.add(bomb);
runtimeInfo.setGameplayObjects(gameplayObjects);
log.info("bomb placed");
checkChangeTiles(graphicsContext);
checkExplosionSpawn(graphicsContext);
}
}
}
public void spawnExplosion(int spawnCordX, int spawnCordY, GraphicsContext graphicsContext){
List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects();
IEntity explosion = EntityFactory.createGameplayObject(ObjectType.EXPLOSION, spawnCordY * scaledTileSize, spawnCordX * scaledTileSize, graphicsContext);
gameplayObjects.add(explosion);
runtimeInfo.setGameplayObjects(gameplayObjects);
log.info("explosion placed");
changeCheckedTileDestructable(graphicsContext);
}
public void checkChangeTiles(GraphicsContext graphicsContext) {
public void checkExplosionSpawn(GraphicsContext graphicsContext) {
boolean isDestructible;
boolean stopDown = false, stopUp = false, stopRight = false, stopLeft = false;
boolean stopUpRight = false, stopUpLeft = false, stopDownRight = false, stopDownLeft = false;
......@@ -459,13 +450,17 @@ class Player implements IEntity {
//spawning heart entity
spawnHeart(x * scaledTileSize, y * scaledTileSize, graphicsContext);
/*List<IEntity> updateList = gameplayObjects.stream().filter(obj -> obj.getOBJECT_STATUS() != ObjectStatus.USED)
.collect(Collectors.toList());
runtimeInfo.setGameplayObjects(updateList);*/
}
}
}
public void spawnExplosion(int spawnCordX, int spawnCordY, GraphicsContext graphicsContext){
List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects();
IEntity explosion = EntityFactory.createGameplayObject(ObjectType.EXPLOSION, spawnCordY * scaledTileSize, spawnCordX * scaledTileSize, graphicsContext);
gameplayObjects.add(explosion);
runtimeInfo.setGameplayObjects(gameplayObjects);
log.info("explosion placed");
changeCheckedTileDestructable(graphicsContext);
}
public void spawnHeart(int x, int y,GraphicsContext graphicsContext){
double dropChance = 0.1;
double randomDropChance = Math.random() * 1;
......@@ -593,7 +588,7 @@ class Player implements IEntity {
health = 0;
log.info("Dead");
}
log.info("DamageTaken current Health: " + health);
log.info("DamageTaken, current Health: " + health);
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment