diff --git a/assets b/assets index f73c8f479..d2ea072f3 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit f73c8f4798bfcd23c98db03bcde2e0afcbce4cfd +Subproject commit d2ea072f32d0ba74cf8c62576f28e7b03d591ddb diff --git a/hmm.json b/hmm.json index 3cd8d5d3d..eefaf86d5 100644 --- a/hmm.json +++ b/hmm.json @@ -46,7 +46,7 @@ "name": "flxanimate", "type": "git", "dir": null, - "ref": "27a0a1f0afc1074f619991472fb3ee209aad28df", + "ref": "280d1a46ac60021d08bb18181631cbd6d061782c", "url": "https://github.com/Dot-Stuff/flxanimate" }, { @@ -205,4 +205,4 @@ "url": "https://github.com/fponticelli/thx.semver" } ] -} +} \ No newline at end of file diff --git a/source/Main.hx b/source/Main.hx index 2426fa0d9..dc462ee5c 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -22,7 +22,7 @@ class Main extends Sprite var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom). var initialState:Class = funkin.InitState; // The FlxState the game starts with. var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions. - #if web + #if (web || CHEEMS) var framerate:Int = 60; // How many frames per second the game should run at. #else // TODO: This should probably be in the options menu? diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index 3c53fe916..80ad59439 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -78,6 +78,7 @@ class CharSelectSubState extends MusicBeatSubState var selectTimer:FlxTimer = new FlxTimer(); var selectSound:FunkinSound; + var unlockSound:FunkinSound; var charSelectCam:FunkinCamera; @@ -270,6 +271,20 @@ class CharSelectSubState extends MusicBeatSubState grpCursors.add(cursorBlue); grpCursors.add(cursor); + selectSound = new FunkinSound(); + selectSound.loadEmbedded(Paths.sound('CS_select')); + selectSound.pitch = 1; + selectSound.volume = 0.7; + + FlxG.sound.defaultSoundGroup.add(selectSound); + + unlockSound = new FunkinSound(); + unlockSound.loadEmbedded(Paths.sound('CS_unlock')); + unlockSound.pitch = 1; + unlockSound.volume = 0.7; + + FlxG.sound.defaultSoundGroup.add(unlockSound); + initLocks(); for (index => member in grpIcons.members) @@ -301,13 +316,6 @@ class CharSelectSubState extends MusicBeatSubState add(temp); temp.alpha = 0.0; - selectSound = new FunkinSound(); - selectSound.loadEmbedded(Paths.sound('CS_select')); - selectSound.pitch = 1; - selectSound.volume = 0.7; - - FlxG.sound.defaultSoundGroup.add(selectSound); - Conductor.stepHit.add(spamOnStep); // FlxG.debugger.track(temp, "tempBG"); @@ -394,58 +402,66 @@ class CharSelectSubState extends MusicBeatSubState var copy = 3; - var yThing = 0; + var yThing = -1; - while (index > copy) + while ((index + 1) > copy) { yThing++; copy += 3; } - var xThing = copy - index - 1; + var xThing = (copy - index - 2) * -1; + // Look, I'd write better code but I had better aneurysms, my bad - Cheems + cursorY = yThing; + cursorX = xThing; - cursorY = 3 - yThing; - cursorX = 3 - xThing; + selectSound.play(true); + + nonLocks.shift(); selectTimer.start(1, function(_) { var lock:Lock = cast grpIcons.group.members[index]; + lock.anim.getFrameLabel("unlockAnim").add(function() { + playerChillOut.playAnimation("death"); + }); + lock.playAnimation("unlock"); + unlockSound.play(true); + + lock.onAnimationComplete.addOnce(function(_) { + camera.flash(0xFFFFFFFF, 0.1); + playerChill.playAnimation("unlock"); + playerChill.visible = true; + + if (nonLocks.length == 0) + { + FunkinSound.playMusic('stayFunky', + { + startingVolume: 1, + overrideExisting: true, + restartTrack: true, + onLoad: function() { + @:privateAccess + gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1); + #if desktop + // On desktop it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5 + // So we want to manually change it! + @:privateAccess + gfChill.analyzer.fftN = 512; + #end + } + }); + } + else + playerChill.onAnimationComplete.addOnce((_) -> unLock()); + }); + playerChill.visible = false; playerChill.switchChar(availableChars[index]); playerChillOut.visible = true; - playerChillOut.playAnimation("death"); - playerChillOut.onAnimationComplete.addOnce((_) -> if (_ == "death") - { - playerChill.playAnimation("unlock"); - playerChill.onAnimationComplete.addOnce(function(_) { - nonLocks.shift(); - - if (nonLocks.length > 0) unLock(); - else - { - FunkinSound.playMusic('stayFunky', - { - startingVolume: 1, - overrideExisting: true, - restartTrack: true, - onLoad: function() { - @:privateAccess - gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1); - #if desktop - // On desktop it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5 - // So we want to manually change it! - @:privateAccess - gfChill.analyzer.fftN = 512; - #end - } - }); - } - }); - playerChill.visible = true; - }); }); } diff --git a/source/funkin/ui/charSelect/Lock.hx b/source/funkin/ui/charSelect/Lock.hx index 42e5d63f4..982145d5c 100644 --- a/source/funkin/ui/charSelect/Lock.hx +++ b/source/funkin/ui/charSelect/Lock.hx @@ -20,7 +20,6 @@ class Lock extends FlxAtlasSprite var arr:Array = ["lock", "lock top 1", "lock top 2", "lock top 3", "lock base fuck it"]; - onAnimationComplete.add((_) -> if (_ == "unlock") playAnimation("idle")); var func = function(name) { var symbol = anim.symbolDictionary[name]; if (symbol != null && symbol.timeline.get("color") != null) symbol.timeline.get("color").get(0).colorEffect = tint;