v0.3.1b: cleaned up code and fixed bugs with distortion trap
This commit is contained in:
@@ -48,6 +48,7 @@ public class InterlevelScene extends PixelScene {
|
||||
private static final String TXT_RESURRECTING= "Resurrecting...";
|
||||
private static final String TXT_RETURNING = "Returning...";
|
||||
private static final String TXT_FALLING = "Falling...";
|
||||
private static final String TXT_RESETTING = "Resetting...";
|
||||
|
||||
private static final String ERR_FILE_NOT_FOUND = "Save file not found. If this error persists after restarting, " +
|
||||
"it may mean this save game is corrupted. Sorry about that.";
|
||||
@@ -55,7 +56,7 @@ public class InterlevelScene extends PixelScene {
|
||||
"it may mean this save game is corrupted. Sorry about that.";
|
||||
|
||||
public static enum Mode {
|
||||
DESCEND, ASCEND, CONTINUE, RESURRECT, RETURN, FALL
|
||||
DESCEND, ASCEND, CONTINUE, RESURRECT, RETURN, FALL, RESET
|
||||
};
|
||||
public static Mode mode;
|
||||
|
||||
@@ -101,6 +102,9 @@ public class InterlevelScene extends PixelScene {
|
||||
case FALL:
|
||||
text = TXT_FALLING;
|
||||
break;
|
||||
case RESET:
|
||||
text = TXT_RESETTING;
|
||||
break;
|
||||
}
|
||||
|
||||
message = PixelScene.createText( text, 9 );
|
||||
@@ -139,6 +143,9 @@ public class InterlevelScene extends PixelScene {
|
||||
case FALL:
|
||||
fall();
|
||||
break;
|
||||
case RESET:
|
||||
reset();
|
||||
break;
|
||||
}
|
||||
|
||||
if ((Dungeon.depth % 5) == 0) {
|
||||
@@ -296,6 +303,15 @@ public class InterlevelScene extends PixelScene {
|
||||
Dungeon.resetLevel();
|
||||
}
|
||||
}
|
||||
|
||||
private void reset() throws IOException {
|
||||
|
||||
Actor.fixTime();
|
||||
|
||||
Dungeon.depth--;
|
||||
Level level = Dungeon.newLevel();
|
||||
Dungeon.switchLevel( level, level.entrance );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBackPressed() {
|
||||
|
||||
Reference in New Issue
Block a user