Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Dec 5, 2024
2 parents 8a292b3 + 6ca660f commit 9a48fc0
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 73 deletions.
Binary file added assets/videos/haxe.mp4
Binary file not shown.
10 changes: 5 additions & 5 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2853,10 +2853,10 @@ class PlayState extends MusicBeatState
{
case 0:
var boyfriendToGrab:Boyfriend = boyfriendMap.get(charChangeNames[0]);
if (boyfriendToGrab != null) bfNoteskin = boyfriendToGrab.noteskin;
if (boyfriendToGrab != null && boyfriendToGrab.noteskin.length > 0) bfNoteskin = boyfriendToGrab.noteskin;
case 1:
var dadToGrab:Character = dadMap.get(charChangeNames[0]);
if (dadToGrab != null) dadNoteskin = dadToGrab.noteskin;
if (dadToGrab != null && dadToGrab.noteskin.length > 0) dadNoteskin = dadToGrab.noteskin;
}
charChangeTimes.shift();
charChangeNames.shift();
Expand Down Expand Up @@ -4493,7 +4493,7 @@ class PlayState extends MusicBeatState
if (ClientPrefs.bfIconStyle == "SB Engine") iconP1.changeIcon('bfsb');
if (ClientPrefs.bfIconStyle == "OS 'Engine'") iconP1.changeIcon('bfos');
}
bfNoteskin = boyfriend.noteskin;
if (boyfriend.noteskin.length > 0) bfNoteskin = boyfriend.noteskin;
}
setOnLuas('boyfriendName', boyfriend.curCharacter);

Expand Down Expand Up @@ -4527,7 +4527,7 @@ class PlayState extends MusicBeatState
}
if (dadAnim != '') dad.playAnim(dadAnim, true);
}
dadNoteskin = dad.noteskin;
if (dad.noteskin.length > 0) dadNoteskin = dad.noteskin;
setOnLuas('dadName', dad.curCharacter);

case 2:
Expand Down Expand Up @@ -5797,7 +5797,7 @@ class PlayState extends MusicBeatState
camHUD.shake(playerChar.shakeIntensity / 2, playerChar.shakeDuration / playbackRate);
}
note.wasGoodHit = true;
if (ClientPrefs.noteSplashes && note.isSustainNote && splashesPerFrame[3] <= 4) spawnHoldSplashOnNote(note);
if (!ClientPrefs.lessBotLag && ClientPrefs.noteSplashes && note.isSustainNote && splashesPerFrame[3] <= 4) spawnHoldSplashOnNote(note);
if (SONG.needsVoices && !ffmpegMode)
if (opponentChart && opponentVocals != null && opponentVocals.volume != 1) opponentVocals.volume = 1;
else if (!opponentChart && vocals.volume != 1 || vocals.volume != 1) vocals.volume = 1;
Expand Down
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

0 comments on commit 9a48fc0

Please sign in to comment.