diff --git a/core/src/main/assets/messages/scenes/scenes.properties b/core/src/main/assets/messages/scenes/scenes.properties index c4d04f331..6a4a22850 100644 --- a/core/src/main/assets/messages/scenes/scenes.properties +++ b/core/src/main/assets/messages/scenes/scenes.properties @@ -75,7 +75,7 @@ scenes.interlevelscene$mode.ascend=Ascending... scenes.interlevelscene$mode.continue=Loading... scenes.interlevelscene$mode.resurrect=Resurrecting... scenes.interlevelscene$mode.return=Returning... -scenes.interlevelscene$mode.fall=Falling... +scenes.interlevelscene$mode.fall=Falling!... scenes.interlevelscene$mode.reset=Resetting... scenes.interlevelscene.file_not_found=Save file not found. If this error persists after restarting, it may mean this save game is corrupted. Sorry about that. scenes.interlevelscene.io_error=Cannot read save file. If this error persists after restarting, it may mean this save game is corrupted. Sorry about that. diff --git a/core/src/main/assets/splashes/caves.jpg b/core/src/main/assets/splashes/caves.jpg new file mode 100644 index 000000000..a32def2fe Binary files /dev/null and b/core/src/main/assets/splashes/caves.jpg differ diff --git a/core/src/main/assets/splashes/city.jpg b/core/src/main/assets/splashes/city.jpg new file mode 100644 index 000000000..d966c1acd Binary files /dev/null and b/core/src/main/assets/splashes/city.jpg differ diff --git a/core/src/main/assets/splashes/halls.jpg b/core/src/main/assets/splashes/halls.jpg new file mode 100644 index 000000000..b13c86e8e Binary files /dev/null and b/core/src/main/assets/splashes/halls.jpg differ diff --git a/core/src/main/assets/splashes/prison.jpg b/core/src/main/assets/splashes/prison.jpg new file mode 100644 index 000000000..206657c4b Binary files /dev/null and b/core/src/main/assets/splashes/prison.jpg differ diff --git a/core/src/main/assets/splashes/sewers.jpg b/core/src/main/assets/splashes/sewers.jpg new file mode 100644 index 000000000..ba4efe86b Binary files /dev/null and b/core/src/main/assets/splashes/sewers.jpg differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java index ec9bda596..82d694cc5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java @@ -248,6 +248,12 @@ public class Assets { public static final String ROGUE = "splashes/rogue.jpg"; public static final String HUNTRESS = "splashes/huntress.jpg"; public static final String DUELIST = "splashes/duelist.jpg"; + + public static final String SEWERS = "splashes/sewers.jpg"; + public static final String PRISON = "splashes/prison.jpg"; + public static final String CAVES = "splashes/caves.jpg"; + public static final String CITY = "splashes/city.jpg"; + public static final String HALLS = "splashes/halls.jpg"; } public static class Sprites { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java index 671570ecc..76a703e5d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -41,15 +41,12 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock; import com.shatteredpixel.shatteredpixeldungeon.windows.WndError; import com.watabou.gltextures.TextureCache; -import com.watabou.glwrap.Blending; import com.watabou.noosa.Camera; import com.watabou.noosa.Game; import com.watabou.noosa.Image; -import com.watabou.noosa.NoosaScript; -import com.watabou.noosa.NoosaScriptNoLighting; -import com.watabou.noosa.SkinnedBlock; import com.watabou.utils.BArray; import com.watabou.utils.DeviceCompat; +import com.watabou.utils.Random; import java.io.FileNotFoundException; import java.io.IOException; @@ -107,11 +104,9 @@ public class InterlevelScene extends PixelScene { switch (mode){ default: loadingDepth = Dungeon.depth; - scrollSpeed = 0; break; case CONTINUE: loadingDepth = GamesInProgress.check(GamesInProgress.curSlot).depth; - scrollSpeed = 5; break; case DESCEND: if (Dungeon.hero == null){ @@ -127,21 +122,17 @@ public class InterlevelScene extends PixelScene { fadeTime = SLOW_FADE; } } - scrollSpeed = 5; break; case FALL: loadingDepth = Dungeon.depth+1; - scrollSpeed = 50; break; case ASCEND: fadeTime = FAST_FADE; if (curTransition != null) loadingDepth = curTransition.destDepth; else loadingDepth = Dungeon.depth-1; - scrollSpeed = -5; break; case RETURN: loadingDepth = returnDepth; - scrollSpeed = returnDepth > Dungeon.depth ? 15 : -15; break; } @@ -152,47 +143,46 @@ public class InterlevelScene extends PixelScene { lastRegion = region; } - if (lastRegion == 1) loadingAsset = Assets.Interfaces.LOADING_SEWERS; - else if (lastRegion == 2) loadingAsset = Assets.Interfaces.LOADING_PRISON; - else if (lastRegion == 3) loadingAsset = Assets.Interfaces.LOADING_CAVES; - else if (lastRegion == 4) loadingAsset = Assets.Interfaces.LOADING_CITY; - else loadingAsset = Assets.Interfaces.LOADING_HALLS; + if (lastRegion == 1) loadingAsset = Assets.Splashes.SEWERS; + else if (lastRegion == 2) loadingAsset = Assets.Splashes.PRISON; + else if (lastRegion == 3) loadingAsset = Assets.Splashes.CAVES; + else if (lastRegion == 4) loadingAsset = Assets.Splashes.CITY; + else loadingAsset = Assets.Splashes.HALLS; if (DeviceCompat.isDebug()){ fadeTime = 0f; } - - SkinnedBlock bg = new SkinnedBlock(Camera.main.width, Camera.main.height, loadingAsset ){ - @Override - protected NoosaScript script() { - return NoosaScriptNoLighting.get(); - } - @Override - public void draw() { - Blending.disable(); - super.draw(); - Blending.enable(); - } - - @Override - public void update() { - super.update(); - offset(0, Game.elapsed * scrollSpeed); - } - }; - bg.scale(4, 4); - bg.autoAdjust = true; - add(bg); + Image background = new Image(loadingAsset); + background.scale.set(Camera.main.height/background.height); + + background.x = (Camera.main.width - background.width())/2f; + background.y = (Camera.main.height - background.height())/2f; + PixelScene.align(background); + add(background); + + Image fadeLeft, fadeRight; + fadeLeft = new Image(TextureCache.createGradient(0xFF000000, 0xFF000000, 0x00000000)); + fadeLeft.x = background.x-2; + fadeLeft.scale.set(3, background.height()); + fadeLeft.visible = background.x > 0; + add(fadeLeft); + + fadeRight = new Image(fadeLeft); + fadeRight.x = background.x + background.width() + 2; + fadeRight.y = background.y + background.height(); + fadeRight.angle = 180; + fadeRight.visible = background.x + background.width() < Camera.main.width; + add(fadeRight); Image im = new Image(TextureCache.createGradient(0xAA000000, 0xBB000000, 0xCC000000, 0xDD000000, 0xFF000000)){ @Override public void update() { super.update(); - if (lastRegion == 6) aa = 1; - else if (phase == Phase.FADE_IN) aa = Math.max( 0, (timeLeft - (fadeTime - 0.333f))); - else if (phase == Phase.FADE_OUT) aa = Math.max( 0, (0.333f - timeLeft)); - else aa = 0; + if (lastRegion == 6) am = 1; + else if (phase == Phase.FADE_IN) am = Math.max( 0, (timeLeft - (fadeTime - 0.333f))); + else if (phase == Phase.FADE_OUT) am = Math.max( 0, (0.333f - timeLeft)); + else am = 0; } }; im.angle = 90; @@ -205,8 +195,8 @@ public class InterlevelScene extends PixelScene { message = PixelScene.renderTextBlock( text, 9 ); message.setPos( - (Camera.main.width - message.width()) / 2, - (Camera.main.height - message.height()) / 2 + (Camera.main.width - message.width() - 6), + (Camera.main.height - message.height() - 6) ); align(message); add( message ); @@ -272,12 +262,10 @@ public class InterlevelScene extends PixelScene { waitingTime += Game.elapsed; - float p = timeLeft / fadeTime; - switch (phase) { case FADE_IN: - message.alpha( 1 - p ); + message.alpha( Math.max(0, fadeTime - (timeLeft-0.333f))); if ((timeLeft -= Game.elapsed) <= 0) { synchronized (thread) { if (!thread.isAlive() && error == null) { @@ -291,7 +279,7 @@ public class InterlevelScene extends PixelScene { break; case FADE_OUT: - message.alpha( p ); + message.alpha( Math.min(1, timeLeft+0.333f) ); if ((timeLeft -= Game.elapsed) <= 0) { Game.switchScene( GameScene.class ); @@ -336,6 +324,14 @@ public class InterlevelScene extends PixelScene { } break; } + + if (mode == Mode.FALL) { + message.setPos( + (Camera.main.width - message.width() - 6) + Random.NormalFloat(-1, 1), + (Camera.main.height - message.height() - 6) + Random.NormalFloat(-1, 1) + ); + align(message); + } } private void descend() throws IOException {