From 683af56d99337ff4295a809ad582025fe5d660e4 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 30 Mar 2018 17:14:26 -0400 Subject: [PATCH] v0.6.4: added new visuals to InterLevelScene --- core/src/main/assets/loading_caves.png | Bin 0 -> 172 bytes core/src/main/assets/loading_city.png | Bin 0 -> 208 bytes core/src/main/assets/loading_halls.png | Bin 0 -> 120 bytes core/src/main/assets/loading_prison.png | Bin 0 -> 475 bytes core/src/main/assets/loading_sewers.png | Bin 0 -> 232 bytes .../shatteredpixeldungeon/Assets.java | 6 ++ .../scenes/InterlevelScene.java | 81 +++++++++++++++++- 7 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 core/src/main/assets/loading_caves.png create mode 100644 core/src/main/assets/loading_city.png create mode 100644 core/src/main/assets/loading_halls.png create mode 100644 core/src/main/assets/loading_prison.png create mode 100644 core/src/main/assets/loading_sewers.png diff --git a/core/src/main/assets/loading_caves.png b/core/src/main/assets/loading_caves.png new file mode 100644 index 0000000000000000000000000000000000000000..5ed484cb349549e0f79ba4809be4c8f494a0c951 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9JOMr-uG=>(o!Z-(m6p`jSf^LP z{0b-@?djqeQo+a=z_9*5gVfjm`x(^B?)_y5{Z)N|AwE0jAVY1*LSKdp*Bj#*7;m}0 zXArEEU&~PU<=z&CU*CUCW%yeCdpg6{?AQMp{=Z)Jo}qTtuKf(btA77y@LT==zu7IV V=5Ki}^+0PFJYD@<);T3K0RRt`Lz(~p literal 0 HcmV?d00001 diff --git a/core/src/main/assets/loading_city.png b/core/src/main/assets/loading_city.png new file mode 100644 index 0000000000000000000000000000000000000000..24da8f4ae10b57d6f19a3f531669cda88369c21e GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^3h)VW-87@?!k)z^HqF_+aMJAN z%Ei5n8{PMW0A(vZT^vIy7)5)wG9EDyV7XqfaRs9z{zyE{($=Q&N^mA2=Y zSn{Fu_S3#RdtO(j@p$c~TTVd{Jd$m(x;N_-*R-CF|H8V}T*T(K-2Ih6M=*H0`njxg HN@xNANNZHN literal 0 HcmV?d00001 diff --git a/core/src/main/assets/loading_halls.png b/core/src/main/assets/loading_halls.png new file mode 100644 index 0000000000000000000000000000000000000000..e41dabc3414becc35bc408d7ffb5805f6c62ae9b GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?bT{NXOC)_{M!@ajEJ1yAf zVZba7zI#iho;o}QI}n2vd(mx1nEg-ZYc0NhDLK~#7F4b6ptgg^`cz~Ht5 z!NTQX|J>cJ|F(_>W&kYPaXmi>Ez63+AcjN;sdO5M4D+I_a*$Z48WSooZ3dG6pzVxG z%>QuIFht8$I9z+1t-agx+S&n1Jg^XHDG(RpsGvb1xUB^y zWp>h{gF*{Dmqwt%WS$uXm$JF?RhjN~?<>sVOu=bR!#*H-^cy_a^LV@Swh+aO*m>Dd z2-3PlR46OeS5TH!(jMjeV=$0|w}IPt{?$!}+I;7utmq)1U``8u49~>W(?5Z)7zYAy RQr!Rm002ovPDHLkV1mlf>5u>b literal 0 HcmV?d00001 diff --git a/core/src/main/assets/loading_sewers.png b/core/src/main/assets/loading_sewers.png new file mode 100644 index 0000000000000000000000000000000000000000..03a9485fc106717d40dc4ba5bd2b6d9755969725 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeXy>jKs-Me>ZZd$&7|Nhmh zS0^SW&fBr3XW6WfkdTI1eGUd996*(=o-U3d6^y(G4Y`{F1lT|PcWw`>bj}tO$$d5V zipGi$*ETGkE&7Y&Y@^)0Zpl?CDiE!R){ gt?G32=$R+%bLK0uZGOo74Co*RPgg&ebxsLQ0KG?G6951J literal 0 HcmV?d00001 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java index 5d41e8912..af92f95c0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java @@ -112,6 +112,12 @@ public class Assets { public static final String WATER_CAVES = "water2.png"; public static final String WATER_CITY = "water3.png"; public static final String WATER_HALLS = "water4.png"; + + public static final String LOADING_SEWERS = "loading_sewers.png"; + public static final String LOADING_PRISON = "loading_prison.png"; + public static final String LOADING_CAVES = "loading_caves.png"; + public static final String LOADING_CITY = "loading_city.png"; + public static final String LOADING_HALLS = "loading_halls.png"; public static final String WEAK_FLOOR = "custom_tiles/weak_floor.png"; public static final String PRISON_QUEST = "custom_tiles/prison_quests.png"; 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 2861727b6..2b87af907 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -34,9 +34,15 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndError; import com.shatteredpixel.shatteredpixeldungeon.windows.WndStory; +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.RenderedText; +import com.watabou.noosa.SkinnedBlock; import com.watabou.noosa.audio.Sample; import java.io.FileNotFoundException; @@ -44,7 +50,7 @@ import java.io.IOException; public class InterlevelScene extends PixelScene { - private static final float TIME_TO_FADE = 0.3f; + private static final float TIME_TO_FADE = 1f; public enum Mode { DESCEND, ASCEND, CONTINUE, RESURRECT, RETURN, FALL, RESET, NONE @@ -73,6 +79,79 @@ public class InterlevelScene extends PixelScene { @Override public void create() { super.create(); + + String loadingAsset; + int loadingDepth; + final float scrollSpeed; + 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) loadingDepth = 1; + else loadingDepth = Dungeon.depth+1; + scrollSpeed = 5; + break; + case FALL: + loadingDepth = Dungeon.depth+1; + scrollSpeed = 100; + break; + case ASCEND: + loadingDepth = Dungeon.depth-1; + scrollSpeed = -5; + break; + case RETURN: + loadingDepth = returnDepth; + scrollSpeed = returnDepth > Dungeon.depth ? 15 : -15; + break; + } + if (loadingDepth <= 5) loadingAsset = Assets.LOADING_SEWERS; + else if (loadingDepth <= 10) loadingAsset = Assets.LOADING_PRISON; + else if (loadingDepth <= 15) loadingAsset = Assets.LOADING_CAVES; + else if (loadingDepth <= 21) loadingAsset = Assets.LOADING_CITY; + else loadingAsset = Assets.LOADING_HALLS; + + 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); + add(bg); + + Image im = new Image(TextureCache.createGradient(0xAA000000, 0xBB000000, 0xCC000000, 0xDD000000, 0xFF000000)){ + @Override + public void update() { + super.update(); + if (phase == Phase.FADE_IN) aa = Math.max( 0, timeLeft - 0.6f); + else if (phase == Phase.FADE_OUT) aa = Math.max( 0, 0.4f - (timeLeft)); + else aa = 0; + } + }; + im.angle = 90; + im.x = Camera.main.width; + im.scale.x = Camera.main.height/5f; + im.scale.y = Camera.main.width; + add(im); String text = Messages.get(Mode.class, mode.name());