|
| 1 | +package abyss.parallelmultiverse; |
| 2 | + |
| 3 | +import java.io.BufferedInputStream; |
| 4 | +import java.io.ByteArrayInputStream; |
| 5 | +import java.io.ByteArrayOutputStream; |
| 6 | +import java.net.URL; |
| 7 | + |
| 8 | +import abyss.lunarengine.Commander; |
| 9 | +import abyss.lunarengine.ICommanderAction; |
| 10 | +import abyss.lunarengine.LunarEngine; |
| 11 | +import abyss.lunarengine.LunarEngineCallback; |
| 12 | +import abyss.lunarengine.LunarEngineTools; |
| 13 | +import abyss.parallelmultiverse.part01textintro.MainTextIntro; |
| 14 | +import abyss.parallelmultiverse.part01textintro.PartTextIntro; |
| 15 | +import abyss.parallelmultiverse.part02abysslogo.MainAbyssLogo; |
| 16 | +import abyss.parallelmultiverse.part02abysslogo.PartAbyssLogo; |
| 17 | +import abyss.parallelmultiverse.part03mosaicbackground.PartMosaicBackground; |
| 18 | +import abyss.parallelmultiverse.part04bobspiral.MainBobSpiral; |
| 19 | +import abyss.parallelmultiverse.part04bobspiral.PartBobSpiral; |
| 20 | +import abyss.parallelmultiverse.part05bobbackground.PartBobBackground; |
| 21 | +import abyss.parallelmultiverse.part06lightningobject.MainLightningObject; |
| 22 | +import abyss.parallelmultiverse.part06lightningobject.PartLightningObject; |
| 23 | +import abyss.parallelmultiverse.part07turnbars.MainTurnBars; |
| 24 | +import abyss.parallelmultiverse.part07turnbars.PartTurnbars; |
| 25 | +import abyss.parallelmultiverse.part08ribbons.PartRibbons; |
| 26 | +import abyss.parallelmultiverse.part09bounce.MainBounce; |
| 27 | +import abyss.parallelmultiverse.part09bounce.PartBounce; |
| 28 | +import abyss.parallelmultiverse.part10confetti.PartConfetti; |
| 29 | +import abyss.parallelmultiverse.part11bobscubes.MainBobCubes; |
| 30 | +import abyss.parallelmultiverse.part11bobscubes.PartBobCubes; |
| 31 | +import abyss.parallelmultiverse.part12eyewave.PartEyeWave; |
| 32 | +import abyss.parallelmultiverse.part13tunnel.MainTunnel; |
| 33 | +import abyss.parallelmultiverse.part13tunnel.PartTunnel; |
| 34 | +import abyss.parallelmultiverse.part14lightningfields.MainLightningFields; |
| 35 | +import abyss.parallelmultiverse.part14lightningfields.PartLightningFields; |
| 36 | +import abyss.parallelmultiverse.part15rgb.MainRGB; |
| 37 | +import abyss.parallelmultiverse.part15rgb.PartRGB; |
| 38 | +import abyss.parallelmultiverse.part16dottyobject.PartDottyObject; |
| 39 | +import abyss.parallelmultiverse.part17splinescroller.MainSplineScroller; |
| 40 | +import abyss.parallelmultiverse.part17splinescroller.PartSplineScroller; |
| 41 | +import abyss.parallelmultiverse.part18creditsbobs.PartCreditsBobs; |
| 42 | +import abyss.parallelmultiverse.part19creditsscroller.MainCreditsScroller; |
| 43 | +import abyss.parallelmultiverse.part19creditsscroller.PartCreditsScroller; |
| 44 | +import abyss.parallelmultiverse.part20lasercutter.MainLaserCutter; |
| 45 | +import abyss.parallelmultiverse.part20lasercutter.PartLaserCutter; |
| 46 | +import oggvorbisplayer.ExamplePlayer; |
| 47 | + |
| 48 | +/* |
| 49 | + * Parallel Multiverse |
| 50 | + * |
| 51 | + * is Abyss´ contribution to the demo competition of the Revision 2020 Demoscene event. |
| 52 | + * |
| 53 | + * Credits: |
| 54 | + * |
| 55 | + * - Music by Neurodancer |
| 56 | + * 'Drop your baggage' taken from the album 'znooQ´d' |
| 57 | + * https://neurowerx.bandcamp.com/album/znooqd |
| 58 | + * |
| 59 | + * - Abyss Logo by Celtic/Axis |
| 60 | + * Used before in the Abyss Amiga demo 'Pulstar'. So once more: Thank you, Niels, again it fits perfect. |
| 61 | + * |
| 62 | + * - Eyeball by Tyshdomos |
| 63 | + * Used before in the Abyss Amiga demo 'Drugstore', cut-out from your great title pic. |
| 64 | + * I think we´ve never met or had personal contact, anyway, thanks Thomas for all your great work. |
| 65 | + * |
| 66 | + * - Sans Forgetica font developed by RMIT University in Melbourne, Australia. |
| 67 | + * Creative Commons Attribution-NonCommercial license. |
| 68 | + * https://creativecommons.org/licenses/by-nc/4.0/ |
| 69 | + * |
| 70 | + * - Ogg Vorbis Player by Jon Kristensen |
| 71 | + * http://www.jcraft.com/jorbis/tutorial/Tutorial.html |
| 72 | + * Creative Commons Attribution-ShareAlike 3.0 |
| 73 | + * https://creativecommons.org/licenses/by/3.0/ |
| 74 | + * |
| 75 | + * - Java Code by Moon |
| 76 | + * |
| 77 | + */ |
| 78 | +public class ParallelMultiverse implements LunarEngineCallback{ |
| 79 | + private static ExamplePlayer oggVorbisPlayer;//Ogg Vorbis Player by Jon Kristensen |
| 80 | + |
| 81 | + public static void main(String[] args){ |
| 82 | + try{ |
| 83 | + LunarEngine.clientName="Parallel Multiverse by Abyss"; |
| 84 | + System.out.println(LunarEngine.clientName); |
| 85 | + final ParallelMultiverse parallelMultiverse=new ParallelMultiverse(); |
| 86 | + parallelMultiverse.initializeMusic(parallelMultiverse); |
| 87 | + LunarEngine.fullscreenExclusiveMode=true; |
| 88 | + LunarEngine.initializeEngine(parallelMultiverse); |
| 89 | + Commander.addCommanderAction(1000,new ICommanderAction(){ |
| 90 | + public void doAction(Object object){ |
| 91 | + parallelMultiverse.startMusic(); |
| 92 | + } |
| 93 | + }); |
| 94 | + |
| 95 | + final PartTextIntro partTextIntro=new PartTextIntro(); |
| 96 | + final PartMosaicBackground partMosaicBackground=new PartMosaicBackground(); |
| 97 | + final PartAbyssLogo partAbyssLogo=new PartAbyssLogo(); |
| 98 | + final PartBobSpiral partBobSpiral=new PartBobSpiral(); |
| 99 | + final PartBobBackground partBobBackground=new PartBobBackground(); |
| 100 | + final PartLightningObject partLightningObject=new PartLightningObject(); |
| 101 | + final PartTurnbars partTurnbars=new PartTurnbars(); |
| 102 | + final PartRibbons partRibbons=new PartRibbons(); |
| 103 | + final PartBounce partBounce=new PartBounce(); |
| 104 | + final PartConfetti partConfetti=new PartConfetti(); |
| 105 | + final PartBobCubes partBobsCubes=new PartBobCubes(); |
| 106 | + final PartEyeWave partEyeWave=new PartEyeWave(); |
| 107 | + final PartTunnel partTunnel=new PartTunnel(); |
| 108 | + final PartRGB partRGB=new PartRGB(); |
| 109 | + final PartLightningFields partLightningFields=new PartLightningFields(); |
| 110 | + final PartDottyObject partDottyObject=new PartDottyObject(); |
| 111 | + final PartSplineScroller partSplineScroller=new PartSplineScroller(); |
| 112 | + final PartCreditsBobs partCreditsBobs=new PartCreditsBobs(); |
| 113 | + final PartCreditsScroller partCreditsScroller=new PartCreditsScroller(); |
| 114 | + final PartLaserCutter partLaserCutter=new PartLaserCutter(); |
| 115 | + |
| 116 | + |
| 117 | + partTextIntro.precalc(); |
| 118 | + MainTextIntro.addCommands(partTextIntro); |
| 119 | + |
| 120 | + partMosaicBackground.precalc(); |
| 121 | + partAbyssLogo.precalc(); |
| 122 | + MainAbyssLogo.addCommands(partAbyssLogo,partMosaicBackground); |
| 123 | + |
| 124 | + partBobSpiral.precalc(); |
| 125 | + MainBobSpiral.addCommands(partBobSpiral, partMosaicBackground); |
| 126 | + |
| 127 | + partBobBackground.precalc(); |
| 128 | + partLightningObject.precalc(); |
| 129 | + MainLightningObject.addCommands(partLightningObject,partMosaicBackground,partBobBackground); |
| 130 | + |
| 131 | + partTurnbars.precalc(); |
| 132 | + MainTurnBars.addCommands(partTurnbars,partBobBackground); |
| 133 | + |
| 134 | + partBounce.precalc(); |
| 135 | + partRibbons.precalc(); |
| 136 | + MainBounce.addCommands(partBounce,partRibbons); |
| 137 | + |
| 138 | + partBobsCubes.precalc(); |
| 139 | + partConfetti.precalc(); |
| 140 | + MainBobCubes.addCommands(partBobsCubes,partRibbons,partConfetti); |
| 141 | + |
| 142 | + partEyeWave.precalc(); |
| 143 | + partTunnel.precalc(); |
| 144 | + MainTunnel.addCommands(partTunnel,partEyeWave); |
| 145 | + |
| 146 | + partRGB.precalc(); |
| 147 | + partLightningFields.precalc(); |
| 148 | + MainLightningFields.addCommands(partLightningFields, partRGB); |
| 149 | + |
| 150 | + partDottyObject.precalc(); |
| 151 | + MainRGB.addCommands(partRGB,partDottyObject); |
| 152 | + |
| 153 | + partSplineScroller.precalc(); |
| 154 | + MainSplineScroller.addCommands(partSplineScroller,partRGB); |
| 155 | + |
| 156 | + partCreditsBobs.precalc(); |
| 157 | + partCreditsScroller.precalc(); |
| 158 | + MainCreditsScroller.addCommands(partCreditsScroller,partCreditsBobs); |
| 159 | + |
| 160 | + partLaserCutter.precalc(); |
| 161 | + MainLaserCutter.addCommands(partLaserCutter,partConfetti); |
| 162 | + |
| 163 | + Commander.start(3); |
| 164 | + LunarEngine.startEngine(); |
| 165 | + }catch(Throwable throwable){ |
| 166 | + LunarEngine.throwableHandler(throwable); |
| 167 | + } |
| 168 | + } |
| 169 | + |
| 170 | + private void initializeMusic(ParallelMultiverse parallelMultiverse) { |
| 171 | + try { |
| 172 | + URL url = LunarEngineTools.getResourceUrl(this,"data/Drop your baggage.ogg"); |
| 173 | + BufferedInputStream bufferedInputStream=new BufferedInputStream(url.openStream()); |
| 174 | + byte[] buffer=new byte[1024]; |
| 175 | + int count; |
| 176 | + ByteArrayOutputStream baos=new ByteArrayOutputStream(); |
| 177 | + while((count=bufferedInputStream.read(buffer))!=-1) { |
| 178 | + baos.write(buffer,0,count); |
| 179 | + } |
| 180 | + bufferedInputStream.close(); |
| 181 | + ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray()); |
| 182 | + oggVorbisPlayer = new ExamplePlayer(bais); |
| 183 | + } catch (Exception e) { |
| 184 | + throw new RuntimeException("error initializing music",e); |
| 185 | + } |
| 186 | + } |
| 187 | + |
| 188 | + private void startMusic() { |
| 189 | + oggVorbisPlayer.start(); |
| 190 | + } |
| 191 | + |
| 192 | + private void stopMusic() { |
| 193 | + oggVorbisPlayer.stopPlayer=true; |
| 194 | + } |
| 195 | + |
| 196 | + public void lunarEngineShutdown() { |
| 197 | + stopMusic(); |
| 198 | + } |
| 199 | + |
| 200 | +} |
0 commit comments