diff --git a/res/levels/test.level b/res/levels/test.level index e6bdf6e..2426e07 100644 --- a/res/levels/test.level +++ b/res/levels/test.level @@ -3,7 +3,7 @@ backgroundMusic:music/bla.wav background:StarBackground - [0-4] -spawn:EnemyBoss,1,1 +spawn:EnemyOne,1,1 [5-10] spawn:EnemyTwo,2,10 [11-25] diff --git a/src/de/teamteamteam/spacescooter/level/Level.java b/src/de/teamteamteam/spacescooter/level/Level.java index ee9fe4c..fdad64a 100644 --- a/src/de/teamteamteam/spacescooter/level/Level.java +++ b/src/de/teamteamteam/spacescooter/level/Level.java @@ -41,7 +41,6 @@ public final class Level { public Level(String levelConfig) { this.levelClock = 0; this.config = Loader.getLevelConfigByFilename(levelConfig); - System.out.println(this.config); } @@ -49,7 +48,7 @@ public final class Level { * Initialize the level based on the LevelConfig attributes. */ public void doBuildUp() { - new StarBackground(0, 50); + this.spawnEntityByAvailableName(Entity.availableNames.valueOf(this.config.background), 0, 50); GameScreen.setPlayer(new Player(200, 300)); } @@ -122,6 +121,9 @@ public final class Level { */ private void spawnEntityByAvailableName(Entity.availableNames entity, int x, int y) { switch(entity) { + case StarBackground: + new StarBackground(x, y); + break; case EnemyOne: new EnemyOne(x, y); break; diff --git a/src/de/teamteamteam/spacescooter/level/LevelConfig.java b/src/de/teamteamteam/spacescooter/level/LevelConfig.java index acd64fa..f99facd 100644 --- a/src/de/teamteamteam/spacescooter/level/LevelConfig.java +++ b/src/de/teamteamteam/spacescooter/level/LevelConfig.java @@ -104,7 +104,6 @@ public class LevelConfig { * Add a given EntitySpawnRule to the ruleList. */ public void addEntitySpawnRule(int intervalStart, int intervalEnd, String entityName, int amount, int spawnRate) { - System.out.println("Adding rule for " + intervalStart + " to " + intervalEnd + ": " + entityName + ", " + amount + ", " + spawnRate); int intervalIndex = this.getIntervalIndexByBorders(intervalStart, intervalEnd); if(intervalIndex == -1) { System.err.println("No Interval for rule found!");