|
@@ -42,7 +42,7 @@ public final class Level
|
|
|
private double time = 0.0;
|
|
|
private double clockTick = 0.0;
|
|
|
|
|
|
- private int tries = 7;
|
|
|
+ //private int tries = 7;
|
|
|
|
|
|
private TreeSet<Point> spawns = new TreeSet<>();
|
|
|
|
|
@@ -60,13 +60,11 @@ public final class Level
|
|
|
// debug stuff
|
|
|
/*if(name.equals("00-Tech Demo"))
|
|
|
{
|
|
|
- int index = data.getBackgroundIndex();
|
|
|
- data.setTile(index, 5, 4, 33);
|
|
|
- data.setTile(index, 14, 4, 34);
|
|
|
+ int index = data.getBackgroundIndex() + 1;
|
|
|
+ data.setTile(index, 10, 6, 2);
|
|
|
+ data.setTile(index, 11, 6, 1);
|
|
|
|
|
|
- data.setTile(index, 15, 4, 64);
|
|
|
-
|
|
|
- for(int layer = 0; layer <= data.getBackgroundIndex(); layer++)
|
|
|
+ /*for(int layer = 0; layer <= data.getBackgroundIndex(); layer++)
|
|
|
{
|
|
|
for(int x = 0; x < data.getWidth(); x++)
|
|
|
{
|
|
@@ -120,6 +118,13 @@ public final class Level
|
|
|
spawns.add(new Point(x, y));
|
|
|
}
|
|
|
});
|
|
|
+ data.forEachEntity((x, y, tile) ->
|
|
|
+ {
|
|
|
+ if(tile == 1)
|
|
|
+ {
|
|
|
+ maxSouls++;
|
|
|
+ }
|
|
|
+ }, 0, data.getWidth(), 0, data.getHeight());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -132,15 +137,8 @@ public final class Level
|
|
|
{
|
|
|
spawns.add(new Point(5, 5));
|
|
|
}
|
|
|
- //spawns.add(new Point(15, 10));
|
|
|
|
|
|
resetLevel();
|
|
|
-
|
|
|
- /*Entity test = EntityBuilder.fromId(3, this, 400, 200);
|
|
|
- entities.put(entityCounter++, test);
|
|
|
-
|
|
|
- test = EntityBuilder.fromId(2, this, 600, 200);
|
|
|
- entities.put(entityCounter++, test);*/
|
|
|
}
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
@@ -175,7 +173,7 @@ public final class Level
|
|
|
|
|
|
public boolean resetLevel()
|
|
|
{
|
|
|
- boolean dead = false;
|
|
|
+ /*boolean dead = false;
|
|
|
if(!done) // hero just died
|
|
|
{
|
|
|
tries--;
|
|
@@ -184,18 +182,18 @@ public final class Level
|
|
|
tries = 7;
|
|
|
dead = true;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
state.resetTiles();
|
|
|
data.activateEntities();
|
|
|
souls = 0;
|
|
|
time = 0.0;
|
|
|
shouldReset = false;
|
|
|
done = false;
|
|
|
- Entity h = spawnHero(dead);
|
|
|
+ Entity h = spawnHero(true);
|
|
|
hero = h;
|
|
|
entities.clear();
|
|
|
entities.put(entityCounter++, h);
|
|
|
- return dead;
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
public void spawnEntity(Entity ent)
|
|
@@ -470,9 +468,9 @@ public final class Level
|
|
|
// gui foreground
|
|
|
renderer.drawFixedImage(AROUND_FOREGROUND, x, y, w, h);
|
|
|
|
|
|
- // tries go over foreground
|
|
|
- renderer.drawFixedImage(LIFE_OVERLAY[tries], x + 89 * scale, y + 52 * scale,
|
|
|
- LIFE_OVERLAY[tries].getWidth() * scale, LIFE_OVERLAY[tries].getHeight() * scale);
|
|
|
+ // tries / health go over foreground
|
|
|
+ renderer.drawFixedImage(LIFE_OVERLAY[hFrame], x + 89 * scale, y + 52 * scale,
|
|
|
+ LIFE_OVERLAY[hFrame].getWidth() * scale, LIFE_OVERLAY[hFrame].getHeight() * scale);
|
|
|
|
|
|
|
|
|
// grey background
|