v0.2.4: reworked final floor

This commit is contained in:
Evan Debenham 2015-02-22 02:26:30 -05:00
parent be563be012
commit cb5cd807b3
3 changed files with 64 additions and 28 deletions

View File

@ -994,8 +994,10 @@ public class Hero extends Char {
if (Actor.findChar( target ) == null) {
if (Level.pit[target] && !flying && !Chasm.jumpConfirmed) {
if (!Level.solid[target]) {
Chasm.heroJump(this);
interrupt();
}
return false;
}
if (Level.passable[target] || Level.avoid[target]) {

View File

@ -63,9 +63,9 @@ public class DeadEndLevel extends Level {
entrance = SIZE * WIDTH + SIZE / 2 + 1;
map[entrance] = Terrain.ENTRANCE;
exit = -1;
exit = (SIZE / 2 + 1) * (WIDTH + 1);
map[(SIZE / 2 + 1) * (WIDTH + 1)] = Terrain.SIGN;
map[exit] = Terrain.SIGN;
return true;
}

View File

@ -27,11 +27,13 @@ import com.watabou.utils.Random;
public class LastLevel extends Level {
private static final int SIZE = 7;
private static final int SIZE = 30;
{
color1 = 0x801500;
color2 = 0xa68521;
viewDistance = 8;
}
private int pedestal;
@ -46,25 +48,56 @@ public class LastLevel extends Level {
return Assets.WATER_HALLS;
}
@Override
public void create() {
super.create();
for (int i=0; i < LENGTH; i++) {
int flags = Terrain.flags[map[i]];
if ((flags & Terrain.PIT) != 0){
passable[i] = avoid[i] = false;
solid[i] = true;
}
}
}
@Override
protected boolean build() {
Arrays.fill( map, Terrain.WALL );
Painter.fill( this, 1, 1, SIZE, SIZE, Terrain.WATER );
Painter.fill( this, 2, 2, SIZE-2, SIZE-2, Terrain.EMPTY );
Painter.fill( this, SIZE/2, SIZE/2, 3, 3, Terrain.EMPTY_SP );
Arrays.fill( map, Terrain.CHASM );
Painter.fill( this, 7, 31, 19, 1, Terrain.WALL );
Painter.fill( this, 15, 10, 3, 21, Terrain.EMPTY);
Painter.fill( this, 13, 30, 7, 1, Terrain.EMPTY);
Painter.fill( this, 14, 29, 5, 1, Terrain.EMPTY);
Painter.fill( this, 14, 9, 5, 7, Terrain.EMPTY);
Painter.fill( this, 13, 10, 7, 5, Terrain.EMPTY);
//Painter.fill( this, 2, 2, SIZE-2, SIZE-2, Terrain.EMPTY );
//Painter.fill( this, SIZE/2, SIZE/2, 3, 3, Terrain.EMPTY_SP );
entrance = SIZE * WIDTH + SIZE / 2 + 1;
map[entrance] = Terrain.ENTRANCE;
exit = entrance - WIDTH * SIZE;
map[exit] = Terrain.LOCKED_EXIT;
pedestal = (SIZE / 2 + 1) * (WIDTH + 1);
pedestal = (SIZE / 2 + 1) * (WIDTH + 1) - 4*WIDTH;
map[pedestal] = Terrain.PEDESTAL;
map[pedestal-1] = map[pedestal+1] = Terrain.STATUE_SP;
map[pedestal-1-WIDTH] = map[pedestal+1-WIDTH] = map[pedestal-1+WIDTH] = map[pedestal+1+WIDTH] = Terrain.STATUE_SP;
exit = pedestal;
int pos = pedestal;
map[pos-WIDTH] = map[pos-1] = map[pos+1] = map[pos-2] = map[pos+2] = Terrain.WATER;
pos+=WIDTH;
map[pos] = map[pos-2] = map[pos+2] = map[pos-3] = map[pos+3] = Terrain.WATER;
pos+=WIDTH;
map[pos-3] = map[pos-2] = map[pos-1] = map[pos] = map[pos+1] = map[pos+2] = map[pos+3] = Terrain.WATER;
pos+=WIDTH;
map[pos-2] = map[pos+2] = Terrain.WATER;
feeling = Feeling.NONE;
viewDistance = 8;
return true;
}
@ -124,6 +157,7 @@ public class LastLevel extends Level {
@Override
public void addVisuals( Scene scene ) {
super.addVisuals( scene );
HallsLevel.addVisuals( this, scene );
}
}