Skip to content

Commit

Permalink
Ho ho ho! Merry christmas!
Browse files Browse the repository at this point in the history
It's time to release 1.40.0!
- Added a rare Santa startup that ONLY shows between the dates 12/16 to 12/31!
- The default menu theme is now a Christmas remix!
  • Loading branch information
JordanSantiagoYT committed Dec 25, 2024
1 parent 1919e42 commit 746b4cd
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 85 deletions.
Binary file modified assets/preload/music/freakyMenu-Default.ogg
Binary file not shown.
Binary file added assets/splash/images/JollySantaLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/splash/sounds/JollySanta.ogg
Binary file not shown.
2 changes: 1 addition & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using StringTools;

class MainMenuState extends MusicBeatState
{
public static var psychEngineJSVersion:String = '1.39.1'; //This is also used for Discord RPC
public static var psychEngineJSVersion:String = '1.40.0'; //This is also used for Discord RPC
public static var psychEngineVersion:String = '0.6.3'; //This is also used for Discord RPC
public static var curSelected:Int = 0;

Expand Down
177 changes: 94 additions & 83 deletions source/StartupState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ class StartupState extends MusicBeatState
var skipTxt:FlxText;

var maxIntros:Int = 3;
var maxSecretIntros:Int = 0; // trolley
var date:Date = Date.now();

var canChristmas = false;

override public function create():Void
{
#if VIDEOS_ALLOWED
maxIntros += 2;
maxSecretIntros += 1;
#end
var theIntro:Int = FlxG.random.int(0, maxIntros);
var theSecretIntro:Int = FlxG.random.int(0, maxSecretIntros);
#if VIDEOS_ALLOWED maxIntros += 2; #end
if (date.getMonth() == 11 && date.getDate() >= 16 && date.getDate() <= 31) //Only triggers if the date is between 12/16 and 12/31
{
canChristmas = true;
maxIntros += 1; //JOLLY SANTA!!!
}

FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
logo = new FlxSprite().loadGraphic(Paths.image('sillyLogo', 'splash'));
Expand All @@ -51,87 +54,12 @@ class StartupState extends MusicBeatState
FlxTween.tween(skipTxt, {alpha: 1}, 1);

new FlxTimer().start(0.1, function(tmr:FlxTimer) {
if (!FlxG.random.bool(0.25)){
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
{
switch (theSecretIntro)
{
case 0:
playVideo('oops');
case 1:
playVideo('haxe');
}
}
doIntro();
});

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, 'splash'), 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, 'splash'));
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 All @@ -142,6 +70,89 @@ class StartupState extends MusicBeatState
});
}

function doIntro() {
var theIntro:Int = FlxG.random.int(0, maxIntros);
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
case 6:
if (canChristmas)
{
FlxG.sound.play(Paths.sound('JollySanta', 'splash'));
logo.loadGraphic(Paths.image('JollySantaLogo', 'splash'));
logo.scale.set(0.1,0.1);
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 2, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone(1.5)});
} else doIntro();
}
}

override function update(elapsed:Float)
{
if (FlxG.keys.justPressed.ENTER) FlxG.switchState(TitleState.new);
Expand Down
2 changes: 1 addition & 1 deletion source/options/OptionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class OptionsState extends MusicBeatState
selectorRight.y = item.y;
}
}
camFollow.setPosition(FlxG.width / 2, 20 + (curSelected * (grpOptions.members.length * 10)));
camFollow.setPosition(FlxG.width / 2, (curSelected * (grpOptions.members.length * 10)));

FlxG.sound.play(Paths.sound('scrollMenu'));
}
Expand Down

0 comments on commit 746b4cd

Please sign in to comment.