v2.5.0: early first impl of region splash arts!

This commit is contained in:
Evan Debenham
2024-08-08 12:34:41 -04:00
parent 19b812d104
commit afe3f71cb5
8 changed files with 50 additions and 48 deletions
@@ -75,7 +75,7 @@ scenes.interlevelscene$mode.ascend=Ascending...
scenes.interlevelscene$mode.continue=Loading... scenes.interlevelscene$mode.continue=Loading...
scenes.interlevelscene$mode.resurrect=Resurrecting... scenes.interlevelscene$mode.resurrect=Resurrecting...
scenes.interlevelscene$mode.return=Returning... scenes.interlevelscene$mode.return=Returning...
scenes.interlevelscene$mode.fall=Falling... scenes.interlevelscene$mode.fall=Falling!...
scenes.interlevelscene$mode.reset=Resetting... 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.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. 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.
Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

@@ -248,6 +248,12 @@ public class Assets {
public static final String ROGUE = "splashes/rogue.jpg"; public static final String ROGUE = "splashes/rogue.jpg";
public static final String HUNTRESS = "splashes/huntress.jpg"; public static final String HUNTRESS = "splashes/huntress.jpg";
public static final String DUELIST = "splashes/duelist.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 { public static class Sprites {
@@ -41,15 +41,12 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndError; import com.shatteredpixel.shatteredpixeldungeon.windows.WndError;
import com.watabou.gltextures.TextureCache; import com.watabou.gltextures.TextureCache;
import com.watabou.glwrap.Blending;
import com.watabou.noosa.Camera; import com.watabou.noosa.Camera;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.noosa.Image; 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.BArray;
import com.watabou.utils.DeviceCompat; import com.watabou.utils.DeviceCompat;
import com.watabou.utils.Random;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
@@ -107,11 +104,9 @@ public class InterlevelScene extends PixelScene {
switch (mode){ switch (mode){
default: default:
loadingDepth = Dungeon.depth; loadingDepth = Dungeon.depth;
scrollSpeed = 0;
break; break;
case CONTINUE: case CONTINUE:
loadingDepth = GamesInProgress.check(GamesInProgress.curSlot).depth; loadingDepth = GamesInProgress.check(GamesInProgress.curSlot).depth;
scrollSpeed = 5;
break; break;
case DESCEND: case DESCEND:
if (Dungeon.hero == null){ if (Dungeon.hero == null){
@@ -127,21 +122,17 @@ public class InterlevelScene extends PixelScene {
fadeTime = SLOW_FADE; fadeTime = SLOW_FADE;
} }
} }
scrollSpeed = 5;
break; break;
case FALL: case FALL:
loadingDepth = Dungeon.depth+1; loadingDepth = Dungeon.depth+1;
scrollSpeed = 50;
break; break;
case ASCEND: case ASCEND:
fadeTime = FAST_FADE; fadeTime = FAST_FADE;
if (curTransition != null) loadingDepth = curTransition.destDepth; if (curTransition != null) loadingDepth = curTransition.destDepth;
else loadingDepth = Dungeon.depth-1; else loadingDepth = Dungeon.depth-1;
scrollSpeed = -5;
break; break;
case RETURN: case RETURN:
loadingDepth = returnDepth; loadingDepth = returnDepth;
scrollSpeed = returnDepth > Dungeon.depth ? 15 : -15;
break; break;
} }
@@ -152,47 +143,46 @@ public class InterlevelScene extends PixelScene {
lastRegion = region; lastRegion = region;
} }
if (lastRegion == 1) loadingAsset = Assets.Interfaces.LOADING_SEWERS; if (lastRegion == 1) loadingAsset = Assets.Splashes.SEWERS;
else if (lastRegion == 2) loadingAsset = Assets.Interfaces.LOADING_PRISON; else if (lastRegion == 2) loadingAsset = Assets.Splashes.PRISON;
else if (lastRegion == 3) loadingAsset = Assets.Interfaces.LOADING_CAVES; else if (lastRegion == 3) loadingAsset = Assets.Splashes.CAVES;
else if (lastRegion == 4) loadingAsset = Assets.Interfaces.LOADING_CITY; else if (lastRegion == 4) loadingAsset = Assets.Splashes.CITY;
else loadingAsset = Assets.Interfaces.LOADING_HALLS; else loadingAsset = Assets.Splashes.HALLS;
if (DeviceCompat.isDebug()){ if (DeviceCompat.isDebug()){
fadeTime = 0f; fadeTime = 0f;
} }
SkinnedBlock bg = new SkinnedBlock(Camera.main.width, Camera.main.height, loadingAsset ){
@Override
protected NoosaScript script() {
return NoosaScriptNoLighting.get();
}
@Override Image background = new Image(loadingAsset);
public void draw() { background.scale.set(Camera.main.height/background.height);
Blending.disable();
super.draw(); background.x = (Camera.main.width - background.width())/2f;
Blending.enable(); background.y = (Camera.main.height - background.height())/2f;
} PixelScene.align(background);
add(background);
@Override
public void update() { Image fadeLeft, fadeRight;
super.update(); fadeLeft = new Image(TextureCache.createGradient(0xFF000000, 0xFF000000, 0x00000000));
offset(0, Game.elapsed * scrollSpeed); fadeLeft.x = background.x-2;
} fadeLeft.scale.set(3, background.height());
}; fadeLeft.visible = background.x > 0;
bg.scale(4, 4); add(fadeLeft);
bg.autoAdjust = true;
add(bg); 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)){ Image im = new Image(TextureCache.createGradient(0xAA000000, 0xBB000000, 0xCC000000, 0xDD000000, 0xFF000000)){
@Override @Override
public void update() { public void update() {
super.update(); super.update();
if (lastRegion == 6) aa = 1; if (lastRegion == 6) am = 1;
else if (phase == Phase.FADE_IN) aa = Math.max( 0, (timeLeft - (fadeTime - 0.333f))); else if (phase == Phase.FADE_IN) am = Math.max( 0, (timeLeft - (fadeTime - 0.333f)));
else if (phase == Phase.FADE_OUT) aa = Math.max( 0, (0.333f - timeLeft)); else if (phase == Phase.FADE_OUT) am = Math.max( 0, (0.333f - timeLeft));
else aa = 0; else am = 0;
} }
}; };
im.angle = 90; im.angle = 90;
@@ -205,8 +195,8 @@ public class InterlevelScene extends PixelScene {
message = PixelScene.renderTextBlock( text, 9 ); message = PixelScene.renderTextBlock( text, 9 );
message.setPos( message.setPos(
(Camera.main.width - message.width()) / 2, (Camera.main.width - message.width() - 6),
(Camera.main.height - message.height()) / 2 (Camera.main.height - message.height() - 6)
); );
align(message); align(message);
add( message ); add( message );
@@ -272,12 +262,10 @@ public class InterlevelScene extends PixelScene {
waitingTime += Game.elapsed; waitingTime += Game.elapsed;
float p = timeLeft / fadeTime;
switch (phase) { switch (phase) {
case FADE_IN: case FADE_IN:
message.alpha( 1 - p ); message.alpha( Math.max(0, fadeTime - (timeLeft-0.333f)));
if ((timeLeft -= Game.elapsed) <= 0) { if ((timeLeft -= Game.elapsed) <= 0) {
synchronized (thread) { synchronized (thread) {
if (!thread.isAlive() && error == null) { if (!thread.isAlive() && error == null) {
@@ -291,7 +279,7 @@ public class InterlevelScene extends PixelScene {
break; break;
case FADE_OUT: case FADE_OUT:
message.alpha( p ); message.alpha( Math.min(1, timeLeft+0.333f) );
if ((timeLeft -= Game.elapsed) <= 0) { if ((timeLeft -= Game.elapsed) <= 0) {
Game.switchScene( GameScene.class ); Game.switchScene( GameScene.class );
@@ -336,6 +324,14 @@ public class InterlevelScene extends PixelScene {
} }
break; 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 { private void descend() throws IOException {