Skip to content

Commit

Permalink
Lily wanted this
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie-coder committed Dec 5, 2024
1 parent df669fc commit 6ca660f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 68 deletions.
Binary file added assets/videos/haxe.mp4
Binary file not shown.
135 changes: 67 additions & 68 deletions source/StartupState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -46,80 +46,79 @@ class StartupState extends MusicBeatState
FlxTween.tween(skipTxt, {alpha: 1}, 1);

new FlxTimer().start(0.1, function(tmr:FlxTimer) {
switch (theIntro) {
case 0:
FlxG.sound.play(Paths.sound('startup', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 0.95, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone()});
case 1:
FlxG.sound.play(Paths.sound('startup', 'splash'));
FlxG.sound.play(Paths.sound('FIREINTHEHOLE', 'splash'));
logo.loadGraphic(Paths.image('lobotomy', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 1.35, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone()});
case 2:
FlxG.sound.play(Paths.sound('screwedEngine', 'splash'));
logo.loadGraphic(Paths.image('ScrewedLogo', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 1.35, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone(0.6)});
case 3:
// secret muaahahhahhahaahha
FlxG.sound.play(Paths.sound('tada', 'splash'));
logo.loadGraphic(Paths.image('JavaScriptLogo', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 1.35, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone(0.6)});
case 4:
#if VIDEOS_ALLOWED
var vidSprite = new MP4Handler(); // it plays but it doesn't show???
#if (hxCodec < "3.0.0")
vidSprite.playVideo(Paths.video('bambiStartup'), false, false);
vidSprite.finishCallback = function()
{
try { vidSprite.dispose(); }
catch (e) {}
FlxG.switchState(TitleState.new);
};
#else
vidSprite.play(Paths.video('bambiStartup'));
vidSprite.onEndReached.add(function(){
vidSprite.dispose();
FlxG.switchState(TitleState.new);
});
#end
#end
case 5:
#if VIDEOS_ALLOWED
var vidSprite = new MP4Handler(); // it plays but it doesn't show???
#if (hxCodec < "3.0.0")
vidSprite.playVideo(Paths.video('broCopiedDenpa'), false, false);
vidSprite.finishCallback = function()
{
try { vidSprite.dispose(); }
catch (e) {}
FlxG.switchState(TitleState.new);
};
#else
vidSprite.play(Paths.video('broCopiedDenpa'));
vidSprite.onEndReached.add(function(){
vidSprite.dispose();
FlxG.switchState(TitleState.new);
});
#end
#end
if (!FlxG.random.bool(0.1)){
switch (theIntro) {
case 0:
FlxG.sound.play(Paths.sound('startup', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 0.95, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone()});
case 1:
FlxG.sound.play(Paths.sound('startup', 'splash'));
FlxG.sound.play(Paths.sound('FIREINTHEHOLE', 'splash'));
logo.loadGraphic(Paths.image('lobotomy', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 1.35, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone()});
case 2:
FlxG.sound.play(Paths.sound('screwedEngine', 'splash'));
logo.loadGraphic(Paths.image('ScrewedLogo', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 1.35, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone(0.6)});
case 3:
// secret muaahahhahhahaahha
FlxG.sound.play(Paths.sound('tada', 'splash'));
logo.loadGraphic(Paths.image('JavaScriptLogo', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 1.35, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone(0.6)});
case 4:
playVideo('bambiStartup');
case 5:
playVideo('broCopiedDenpa');
}
}
else
playVideo('haxe'); // Lily wanted this
});

super.create();
}

// shorter & cleaner code = better :3
private function playVideo(name:String, ?callback:Void->Void):Void
{
#if VIDEOS_ALLOWED
var vidSprite = new MP4Handler(); // it plays but it doesn't show???
#if (hxCodec < "3.0.0")
vidSprite.playVideo(Paths.video(name), false, false);
vidSprite.finishCallback = function()
{
try { vidSprite.dispose(); }
catch (e) {}
if (callback != null)
callback();
else
FlxG.switchState(TitleState.new);
};
#else
vidSprite.play(Paths.video(name));
vidSprite.onEndReached.add(function(){
vidSprite.dispose();
if (callback != null)
callback();
else
FlxG.switchState(TitleState.new);
});
#end
#end
}

function onIntroDone(?fadeDelay:Float = 0) {
FlxTween.tween(logo, {alpha: 0}, 1, {
startDelay: fadeDelay,
Expand Down

1 comment on commit 6ca660f

@StinkTheStinker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what

Please sign in to comment.