@@ -46,80 +46,79 @@ class StartupState extends MusicBeatState
4646 FlxTween .tween (skipTxt , {alpha : 1 }, 1 );
4747
4848 new FlxTimer ().start (0.1 , function (tmr : FlxTimer ) {
49- switch (theIntro ) {
50- case 0 :
51- FlxG .sound .play (Paths .sound (' startup' , ' splash' ));
52- logo .scale .set (0.1 ,0.1 );
53- logo .updateHitbox ();
54- logo .screenCenter ();
55- FlxTween .tween (logo , {alpha : 1 , " scale.x" : 1 , " scale.y" : 1 }, 0.95 , {ease : FlxEase .expoOut , onComplete : _ -> onIntroDone ()});
56- case 1 :
57- FlxG .sound .play (Paths .sound (' startup' , ' splash' ));
58- FlxG .sound .play (Paths .sound (' FIREINTHEHOLE' , ' splash' ));
59- logo .loadGraphic (Paths .image (' lobotomy' , ' splash' ));
60- logo .scale .set (0.1 ,0.1 );
61- logo .updateHitbox ();
62- logo .screenCenter ();
63- FlxTween .tween (logo , {alpha : 1 , " scale.x" : 1 , " scale.y" : 1 }, 1.35 , {ease : FlxEase .expoOut , onComplete : _ -> onIntroDone ()});
64- case 2 :
65- FlxG .sound .play (Paths .sound (' screwedEngine' , ' splash' ));
66- logo .loadGraphic (Paths .image (' ScrewedLogo' , ' splash' ));
67- logo .scale .set (0.1 ,0.1 );
68- logo .updateHitbox ();
69- logo .screenCenter ();
70- FlxTween .tween (logo , {alpha : 1 , " scale.x" : 1 , " scale.y" : 1 }, 1.35 , {ease : FlxEase .expoOut , onComplete : _ -> onIntroDone (0.6 )});
71- case 3 :
72- // secret muaahahhahhahaahha
73- FlxG .sound .play (Paths .sound (' tada' , ' splash' ));
74- logo .loadGraphic (Paths .image (' JavaScriptLogo' , ' splash' ));
75- logo .scale .set (0.1 ,0.1 );
76- logo .updateHitbox ();
77- logo .screenCenter ();
78- FlxTween .tween (logo , {alpha : 1 , " scale.x" : 1 , " scale.y" : 1 }, 1.35 , {ease : FlxEase .expoOut , onComplete : _ -> onIntroDone (0.6 )});
79- case 4 :
80- #if VIDEOS_ALLOWED
81- var vidSprite = new MP4Handler (); // it plays but it doesn't show???
82- #if (hxCodec < "3.0.0")
83- vidSprite .playVideo (Paths .video (' bambiStartup' ), false , false );
84- vidSprite .finishCallback = function ()
85- {
86- try { vidSprite .dispose (); }
87- catch (e ) {}
88- FlxG .switchState (TitleState .new );
89- };
90- #else
91- vidSprite .play (Paths .video (' bambiStartup' ));
92- vidSprite .onEndReached .add (function (){
93- vidSprite .dispose ();
94- FlxG .switchState (TitleState .new );
95- });
96- #end
97- #end
98- case 5 :
99- #if VIDEOS_ALLOWED
100- var vidSprite = new MP4Handler (); // it plays but it doesn't show???
101- #if (hxCodec < "3.0.0")
102- vidSprite .playVideo (Paths .video (' broCopiedDenpa' ), false , false );
103- vidSprite .finishCallback = function ()
104- {
105- try { vidSprite .dispose (); }
106- catch (e ) {}
107- FlxG .switchState (TitleState .new );
108- };
109- #else
110- vidSprite .play (Paths .video (' broCopiedDenpa' ));
111- vidSprite .onEndReached .add (function (){
112- vidSprite .dispose ();
113- FlxG .switchState (TitleState .new );
114- });
115- #end
116- #end
49+ if (! FlxG .random .bool (0.1 )){
50+ switch (theIntro ) {
51+ case 0 :
52+ FlxG .sound .play (Paths .sound (' startup' , ' splash' ));
53+ logo .scale .set (0.1 ,0.1 );
54+ logo .updateHitbox ();
55+ logo .screenCenter ();
56+ FlxTween .tween (logo , {alpha : 1 , " scale.x" : 1 , " scale.y" : 1 }, 0.95 , {ease : FlxEase .expoOut , onComplete : _ -> onIntroDone ()});
57+ case 1 :
58+ FlxG .sound .play (Paths .sound (' startup' , ' splash' ));
59+ FlxG .sound .play (Paths .sound (' FIREINTHEHOLE' , ' splash' ));
60+ logo .loadGraphic (Paths .image (' lobotomy' , ' splash' ));
61+ logo .scale .set (0.1 ,0.1 );
62+ logo .updateHitbox ();
63+ logo .screenCenter ();
64+ FlxTween .tween (logo , {alpha : 1 , " scale.x" : 1 , " scale.y" : 1 }, 1.35 , {ease : FlxEase .expoOut , onComplete : _ -> onIntroDone ()});
65+ case 2 :
66+ FlxG .sound .play (Paths .sound (' screwedEngine' , ' splash' ));
67+ logo .loadGraphic (Paths .image (' ScrewedLogo' , ' splash' ));
68+ logo .scale .set (0.1 ,0.1 );
69+ logo .updateHitbox ();
70+ logo .screenCenter ();
71+ FlxTween .tween (logo , {alpha : 1 , " scale.x" : 1 , " scale.y" : 1 }, 1.35 , {ease : FlxEase .expoOut , onComplete : _ -> onIntroDone (0.6 )});
72+ case 3 :
73+ // secret muaahahhahhahaahha
74+ FlxG .sound .play (Paths .sound (' tada' , ' splash' ));
75+ logo .loadGraphic (Paths .image (' JavaScriptLogo' , ' splash' ));
76+ logo .scale .set (0.1 ,0.1 );
77+ logo .updateHitbox ();
78+ logo .screenCenter ();
79+ FlxTween .tween (logo , {alpha : 1 , " scale.x" : 1 , " scale.y" : 1 }, 1.35 , {ease : FlxEase .expoOut , onComplete : _ -> onIntroDone (0.6 )});
80+ case 4 :
81+ playVideo (' bambiStartup' );
82+ case 5 :
83+ playVideo (' broCopiedDenpa' );
84+ }
11785 }
86+ else
87+ playVideo (' haxe' ); // Lily wanted this
11888 });
11989
12090 super .create ();
12191 }
12292
93+ // shorter & cleaner code = better :3
94+ private function playVideo (name : String , ? callback : Void -> Void ): Void
95+ {
96+ #if VIDEOS_ALLOWED
97+ var vidSprite = new MP4Handler (); // it plays but it doesn't show???
98+ #if (hxCodec < "3.0.0")
99+ vidSprite .playVideo (Paths .video (name ), false , false );
100+ vidSprite .finishCallback = function ()
101+ {
102+ try { vidSprite .dispose (); }
103+ catch (e ) {}
104+ if (callback != null )
105+ callback ();
106+ else
107+ FlxG .switchState (TitleState .new );
108+ };
109+ #else
110+ vidSprite .play (Paths .video (name ));
111+ vidSprite .onEndReached .add (function (){
112+ vidSprite .dispose ();
113+ if (callback != null )
114+ callback ();
115+ else
116+ FlxG .switchState (TitleState .new );
117+ });
118+ #end
119+ #end
120+ }
121+
123122 function onIntroDone (? fadeDelay : Float = 0 ) {
124123 FlxTween .tween (logo , {alpha : 0 }, 1 , {
125124 startDelay : fadeDelay ,
0 commit comments