Skip to content

Commit

Permalink
we do little trolley
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Dec 5, 2024
1 parent 6ca660f commit 2864558
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added assets/splash/videos/oops.mp4
Binary file not shown.
4 changes: 2 additions & 2 deletions source/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,15 @@ class Paths
return getPath('$key.lua', TEXT, library);
}
//Video loading (part of it)
static public function video(key:String)
static public function video(key:String, ?library:String = null)
{
#if MODS_ALLOWED
var file:String = modsVideo(key);
if(FileSystem.exists(file)) {
return file;
}
#end
return 'assets/videos/$key.$VIDEO_EXT';
return 'assets/${(library != null) ? '$library/' : ''}videos/$key.$VIDEO_EXT';
}
//Sound loading.
static public function sound(key:String, ?library:String):Sound
Expand Down
22 changes: 16 additions & 6 deletions source/StartupState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ class StartupState extends MusicBeatState
var skipTxt:FlxText;

var maxIntros:Int = 3;
var maxSecretIntros:Int = -1; // trolley

override public function create():Void
{
#if VIDEOS_ALLOWED maxIntros += 2; #end
#if VIDEOS_ALLOWED maxIntros = maxSecretIntros += 2; #end
var theIntro:Int = FlxG.random.int(0, maxIntros);
var theSecretIntro:Int = FlxG.random.int(0, maxSecretIntros);
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
logo = new FlxSprite().loadGraphic(Paths.image('sillyLogo', 'splash'));
Expand All @@ -46,7 +48,7 @@ class StartupState extends MusicBeatState
FlxTween.tween(skipTxt, {alpha: 1}, 1);

new FlxTimer().start(0.1, function(tmr:FlxTimer) {
if (!FlxG.random.bool(0.1)){
/*if (!FlxG.random.bool(0.25)){
switch (theIntro) {
case 0:
FlxG.sound.play(Paths.sound('startup', 'splash'));
Expand Down Expand Up @@ -83,8 +85,16 @@ class StartupState extends MusicBeatState
playVideo('broCopiedDenpa');
}
}
else
playVideo('haxe'); // Lily wanted this
else*/
{
switch (theSecretIntro)
{
case 1:
playVideo('haxe');
default:
playVideo('oops');
}
}
});

super.create();
Expand All @@ -96,7 +106,7 @@ class StartupState extends MusicBeatState
#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.playVideo(Paths.video(name, 'splash'), false, false);
vidSprite.finishCallback = function()
{
try { vidSprite.dispose(); }
Expand All @@ -107,7 +117,7 @@ class StartupState extends MusicBeatState
FlxG.switchState(TitleState.new);
};
#else
vidSprite.play(Paths.video(name));
vidSprite.play(Paths.video(name, 'splash'));
vidSprite.onEndReached.add(function(){
vidSprite.dispose();
if (callback != null)
Expand Down

0 comments on commit 2864558

Please sign in to comment.