From a652bfe9f0334f42dd65bc35a922f869e7e8b0fd Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 7 May 2024 14:01:00 -0400 Subject: [PATCH 01/55] Fix an error related to an easter egg, plus some warnings. --- assets | 2 +- source/funkin/play/GameOverSubState.hx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets b/assets index fe52d20de..ff24bb59b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit fe52d20de7025d90cadb429dbdedf6d986727088 +Subproject commit ff24bb59b5382677277ae427a164ea4764409f5c diff --git a/source/funkin/play/GameOverSubState.hx b/source/funkin/play/GameOverSubState.hx index e7b128385..c3abbcf3e 100644 --- a/source/funkin/play/GameOverSubState.hx +++ b/source/funkin/play/GameOverSubState.hx @@ -83,6 +83,8 @@ class GameOverSubState extends MusicBeatSubState var isChartingMode:Bool = false; + var mustNotExit:Bool = false; + var transparent:Bool; static final CAMERA_ZOOM_DURATION:Float = 0.5; @@ -240,7 +242,7 @@ class GameOverSubState extends MusicBeatSubState } // KEYBOARD ONLY: Return to the menu when pressing the assigned key. - if (controls.BACK) + if (controls.BACK && !mustNotExit) { blueballed = false; PlayState.instance.deathCounter = 0; From 7ff37ae0c22f8fa38bf4b04bad43d21cab85a35a Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 7 May 2024 14:21:22 -0400 Subject: [PATCH 02/55] Fix a conflict between a shader variable name and a function on some graphics cards. --- source/funkin/graphics/shaders/StrokeShader.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/funkin/graphics/shaders/StrokeShader.hx b/source/funkin/graphics/shaders/StrokeShader.hx index fd133ac0a..d110e7de9 100644 --- a/source/funkin/graphics/shaders/StrokeShader.hx +++ b/source/funkin/graphics/shaders/StrokeShader.hx @@ -40,8 +40,8 @@ class StrokeShader extends FlxShader void main() { - vec4 sample = flixel_texture2D(bitmap, openfl_TextureCoordv); - if (sample.a == 0.) { + vec4 gay = flixel_texture2D(bitmap, openfl_TextureCoordv); + if (gay.a == 0.) { float w = size.x / openfl_TextureSize.x; float h = size.y / openfl_TextureSize.y; @@ -49,9 +49,9 @@ class StrokeShader extends FlxShader || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y - h)).a != 0.) - sample = color; + gay = color; } - gl_FragColor = sample; + gl_FragColor = gay; } ') public function new(color:FlxColor = 0xFFFFFFFF, width:Float = 1, height:Float = 1) From 8267998f5c9af77ca4c0c80c3f3b40a142e08208 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 7 May 2024 19:26:10 -0400 Subject: [PATCH 03/55] update submodules and git modules for codebase --- .gitmodules | 4 ++-- art | 2 +- assets | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index ad8099e60..be5e0aaa8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "assets"] path = assets - url = https://github.com/FunkinCrew/Funkin-assets-secret + url = https://github.com/FunkinCrew/funkin.assets [submodule "art"] path = art - url = https://github.com/FunkinCrew/Funkin-art-secret + url = https://github.com/FunkinCrew/funkin.art diff --git a/art b/art index f72947b65..66572f85d 160000 --- a/art +++ b/art @@ -1 +1 @@ -Subproject commit f72947b65fe0555821f827dccd562f01d308486d +Subproject commit 66572f85d826ce2ec1d45468c12733b161237ffa diff --git a/assets b/assets index fe52d20de..962130b22 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit fe52d20de7025d90cadb429dbdedf6d986727088 +Subproject commit 962130b2243a839106607d08a11599b1857bf8b3 From dee03f74298cfaac0e59accb647a2946c3e567a2 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 7 May 2024 20:30:45 -0400 Subject: [PATCH 04/55] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 39c098af5..259948012 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ -# Friday Night Funkin' · [![GitHub license](https://img.shields.io/badge/license-Modified%20Apache%20V2-blue.svg)](https://github.com/ninjamuffin99/Funkin/blob/master/LICENSE.md) ![Repo size](https://img.shields.io/github/repo-size/ninjamuffin99/Funkin) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/ninjamuffin99/Funkin/pulls) +# Friday Night Funkin' -Friday Night Funkin' is a rhythm game that doubles as a playable cartoon. Built using HaxeFlixel for Ludem Dare 47. +Friday Night Funkin' is a rhythm game. Built using HaxeFlixel for Ludem Dare 47. This game was made with love to Newgrounds and it's community. Extra love to Tom Fulp. -## [Play for free on Newgrounds!](https://www.newgrounds.com/portal/view/770371) -## [Download builds for Windows, Mac, and Linux from Itch.io!](https://ninja-muffin24.itch.io/funkin) - -![Friday Night Funkin' Logo](./art/thumbnailNewer.png) +- [Playable web demo on Newgrounds!](https://www.newgrounds.com/portal/view/770371) +- [Demo download builds for Windows, Mac, and Linux from Itch.io!](https://ninja-muffin24.itch.io/funkin) # Getting Started @@ -21,6 +19,8 @@ Please check out our [Contributor's guide](./CONTRIBUTORS.md) on how you can act # Credits and Special Thanks +Full credits can be found in-game, or wherever the credits.json file is. + ## Programming - [ninjamuffin99](https://twitter.com/ninja_muffin99) - Lead Programmer - [MasterEric](https://twitter.com/EliteMasterEric) - Programmer From 1927e38bc236d680d08d21b9c4ab1bfa4cc56594 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 7 May 2024 20:31:19 -0400 Subject: [PATCH 05/55] case sensitive markdown --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 259948012..62794b924 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This game was made with love to Newgrounds and it's community. Extra love to Tom **PLEASE USE THE LINKS ABOVE IF YOU JUST WANT TO PLAY THE GAME** -To learn how to install the necessary dependencies and compile the game from source, please check out our [building the game](/docs/compiling.md) guide. +To learn how to install the necessary dependencies and compile the game from source, please check out our [building the game](/docs/COMPILING.md) guide. # Contributing From 39e7f008ea930c070898d2d5be0739af2631b034 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 7 May 2024 20:31:41 -0400 Subject: [PATCH 06/55] Update COMPILING.md --- docs/COMPILING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/COMPILING.md b/docs/COMPILING.md index 442142e9b..7278e027c 100644 --- a/docs/COMPILING.md +++ b/docs/COMPILING.md @@ -3,7 +3,7 @@ 0. Setup - Download Haxe from [Haxe.org](https://haxe.org) 1. Cloning the Repository: Make sure when you clone, you clone the submodules to get the assets repo: - - `git clone --recurse-submodules https://github.com/FunkinCrew/funkin-secret.git` + - `git clone --recurse-submodules https://github.com/FunkinCrew/funkin.git` - If you accidentally cloned without the `assets` submodule (aka didn't follow the step above), you can run `git submodule update --init --recursive` to get the assets in a foolproof way. 2. Install `hmm` (run `haxelib --global install hmm` and then `haxelib --global run hmm setup`) 3. Install all haxelibs of the current branch by running `hmm install` From d51809ea2f463f8d3ef7262da028777740a1bee3 Mon Sep 17 00:00:00 2001 From: Jakub Marcowski <37378746+Chubercik@users.noreply.github.com> Date: Wed, 8 May 2024 03:15:07 +0200 Subject: [PATCH 07/55] Fix the `funkin-assets` license link --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 92fcb686f..f7c1c42e9 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -5,7 +5,7 @@ The Friday Night Funkin' source code is licensed under the Apache 2.0 license: ( Friday Night Funkin' Copyright 2020-2024 The Funkin' Crew Inc. All Rights Reserved. "Friday Night Funkin'" and the "Friday Night Funkin'" logo are trademarks of The Funkin' Crew Inc. -You can view the `funkin-assets` license here: (https://github.com/FunkinCrew/funkin-assets/blob/main/LICENSE.md) +You can view the `funkin-assets` license here: (https://github.com/FunkinCrew/funkin.assets/blob/main/LICENSE.md) ## Apache 2.0 License From 5160fd02d4c21de10f40e3b6817d3ddf405c82f4 Mon Sep 17 00:00:00 2001 From: TheGalo X <88469278+TheGaloXx@users.noreply.github.com> Date: Tue, 7 May 2024 23:17:49 -0300 Subject: [PATCH 08/55] fix window tween --- source/funkin/ui/title/TitleState.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/source/funkin/ui/title/TitleState.hx b/source/funkin/ui/title/TitleState.hx index 964e0eeca..49bef5e4a 100644 --- a/source/funkin/ui/title/TitleState.hx +++ b/source/funkin/ui/title/TitleState.hx @@ -283,6 +283,7 @@ class TitleState extends MusicBeatState if (FlxG.keys.justPressed.Y) { + FlxTween.cancelTweensOf(FlxG.stage.window, ['x', 'y']); FlxTween.tween(FlxG.stage.window, {x: FlxG.stage.window.x + 300}, 1.4, {ease: FlxEase.quadInOut, type: PINGPONG, startDelay: 0.35}); FlxTween.tween(FlxG.stage.window, {y: FlxG.stage.window.y + 100}, 0.7, {ease: FlxEase.quadInOut, type: PINGPONG}); } From e2613fa8fb4d3ab9b7f4cf110893cbb9e25ba632 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 7 May 2024 23:45:35 -0400 Subject: [PATCH 09/55] Fix an issue with an improper version of funkVis --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index c359d7a51..a6e4467a9 100644 --- a/hmm.json +++ b/hmm.json @@ -49,7 +49,7 @@ "name": "funkin.vis", "type": "git", "dir": null, - "ref": "98c9db09f0bbfedfe67a84538a5814aaef80bdea", + "ref": "2aa654b974507ab51ab1724d2d97e75726fd7d78", "url": "https://github.com/FunkinCrew/funkVis" }, { From be0776010364fda81554a845461d71a2ad4a16a1 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 8 May 2024 00:08:44 -0400 Subject: [PATCH 10/55] Fix a crash when querying FlxG.state --- source/funkin/util/logging/CrashHandler.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/funkin/util/logging/CrashHandler.hx b/source/funkin/util/logging/CrashHandler.hx index 8cfa2270f..71d1ad394 100644 --- a/source/funkin/util/logging/CrashHandler.hx +++ b/source/funkin/util/logging/CrashHandler.hx @@ -141,7 +141,9 @@ class CrashHandler fullContents += '\n'; - fullContents += 'Flixel Current State: ${Type.getClassName(Type.getClass(FlxG.state))}\n'; + var currentState = FlxG.state != null ? Type.getClassName(Type.getClass(FlxG.state)) : 'No state loaded'; + + fullContents += 'Flixel Current State: ${currentState}\n'; fullContents += '\n'; From cfeca56634628a7cbaff085df62eafa9c193961d Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 7 May 2024 14:01:00 -0400 Subject: [PATCH 11/55] Fix an error related to an easter egg, plus some warnings. --- source/funkin/play/GameOverSubState.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/funkin/play/GameOverSubState.hx b/source/funkin/play/GameOverSubState.hx index e7b128385..c3abbcf3e 100644 --- a/source/funkin/play/GameOverSubState.hx +++ b/source/funkin/play/GameOverSubState.hx @@ -83,6 +83,8 @@ class GameOverSubState extends MusicBeatSubState var isChartingMode:Bool = false; + var mustNotExit:Bool = false; + var transparent:Bool; static final CAMERA_ZOOM_DURATION:Float = 0.5; @@ -240,7 +242,7 @@ class GameOverSubState extends MusicBeatSubState } // KEYBOARD ONLY: Return to the menu when pressing the assigned key. - if (controls.BACK) + if (controls.BACK && !mustNotExit) { blueballed = false; PlayState.instance.deathCounter = 0; From 2743a853bcaf87e0ecc908ca232ce748e12deabc Mon Sep 17 00:00:00 2001 From: Burgerballs <107233412+Burgerballs@users.noreply.github.com> Date: Wed, 8 May 2024 06:03:12 +0100 Subject: [PATCH 12/55] Fix some spaghetti on PlayAnimationSongEvent --- .../play/event/PlayAnimationSongEvent.hx | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/source/funkin/play/event/PlayAnimationSongEvent.hx b/source/funkin/play/event/PlayAnimationSongEvent.hx index 4e6669479..4ced26b2d 100644 --- a/source/funkin/play/event/PlayAnimationSongEvent.hx +++ b/source/funkin/play/event/PlayAnimationSongEvent.hx @@ -31,25 +31,13 @@ class PlayAnimationSongEvent extends SongEvent switch (targetName) { - case 'boyfriend': + case 'boyfriend' || 'bf' || 'player': trace('Playing animation $anim on boyfriend.'); target = PlayState.instance.currentStage.getBoyfriend(); - case 'bf': - trace('Playing animation $anim on boyfriend.'); - target = PlayState.instance.currentStage.getBoyfriend(); - case 'player': - trace('Playing animation $anim on boyfriend.'); - target = PlayState.instance.currentStage.getBoyfriend(); - case 'dad': + case 'dad' || 'opponent': trace('Playing animation $anim on dad.'); target = PlayState.instance.currentStage.getDad(); - case 'opponent': - trace('Playing animation $anim on dad.'); - target = PlayState.instance.currentStage.getDad(); - case 'girlfriend': - trace('Playing animation $anim on girlfriend.'); - target = PlayState.instance.currentStage.getGirlfriend(); - case 'gf': + case 'girlfriend' || 'gf': trace('Playing animation $anim on girlfriend.'); target = PlayState.instance.currentStage.getGirlfriend(); default: From 000e256b0e6e5d65d96f84fc7a18bfaba507d5d2 Mon Sep 17 00:00:00 2001 From: codist <50346006+ImCodist@users.noreply.github.com> Date: Wed, 8 May 2024 01:20:39 -0400 Subject: [PATCH 13/55] Fixed an issue where hold note would be invisible for a single frame. --- source/funkin/play/notes/Strumline.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/funkin/play/notes/Strumline.hx b/source/funkin/play/notes/Strumline.hx index 6a18f17d5..95e0668be 100644 --- a/source/funkin/play/notes/Strumline.hx +++ b/source/funkin/play/notes/Strumline.hx @@ -576,6 +576,8 @@ class Strumline extends FlxSpriteGroup note.holdNoteSprite.hitNote = true; note.holdNoteSprite.missedNote = false; note.holdNoteSprite.alpha = 1.0; + + note.holdNoteSprite.sustainLength = (note.holdNoteSprite.strumTime + note.holdNoteSprite.fullSustainLength) - conductorInUse.songPosition; } } From 2e74678cafbc0d44559c2eb85b6847dd8cb8e249 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 8 May 2024 01:54:48 -0400 Subject: [PATCH 14/55] Fix an issue where the Freeplay menu never displays 100% clear. --- source/funkin/ui/freeplay/FreeplayState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 7b7543845..5960795ea 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -733,8 +733,8 @@ class FreeplayState extends MusicBeatSubState } } - lerpScore = MathUtil.coolLerp(lerpScore, intendedScore, 0.2); - lerpCompletion = MathUtil.coolLerp(lerpCompletion, intendedCompletion, 0.9); + lerpScore = MathUtil.smoothLerp(lerpScore, intendedScore, elapsed, 0.5); + lerpCompletion = MathUtil.smoothLerp(lerpCompletion, intendedCompletion, elapsed, 0.5); if (Math.isNaN(lerpScore)) { From 4e5531744a1e7ee2023725badfabc2219e3ac4a0 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 8 May 2024 03:23:00 -0400 Subject: [PATCH 15/55] Curse you burgerballs --- source/funkin/play/event/PlayAnimationSongEvent.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/play/event/PlayAnimationSongEvent.hx b/source/funkin/play/event/PlayAnimationSongEvent.hx index 4ced26b2d..57240d399 100644 --- a/source/funkin/play/event/PlayAnimationSongEvent.hx +++ b/source/funkin/play/event/PlayAnimationSongEvent.hx @@ -31,13 +31,13 @@ class PlayAnimationSongEvent extends SongEvent switch (targetName) { - case 'boyfriend' || 'bf' || 'player': + case 'boyfriend' | 'bf' | 'player': trace('Playing animation $anim on boyfriend.'); target = PlayState.instance.currentStage.getBoyfriend(); - case 'dad' || 'opponent': + case 'dad' | 'opponent': trace('Playing animation $anim on dad.'); target = PlayState.instance.currentStage.getDad(); - case 'girlfriend' || 'gf': + case 'girlfriend' | 'gf': trace('Playing animation $anim on girlfriend.'); target = PlayState.instance.currentStage.getGirlfriend(); default: From b49fac742f0ce72386ed3dedec6efad0385de164 Mon Sep 17 00:00:00 2001 From: codist <50346006+ImCodist@users.noreply.github.com> Date: Wed, 8 May 2024 04:21:30 -0400 Subject: [PATCH 16/55] Fixed stutter once a transition to the main menu completes. --- source/funkin/ui/mainmenu/MainMenuState.hx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/funkin/ui/mainmenu/MainMenuState.hx b/source/funkin/ui/mainmenu/MainMenuState.hx index 466dbbb90..7a21a6e8f 100644 --- a/source/funkin/ui/mainmenu/MainMenuState.hx +++ b/source/funkin/ui/mainmenu/MainMenuState.hx @@ -139,10 +139,6 @@ class MainMenuState extends MusicBeatState resetCamStuff(); - subStateClosed.add(_ -> { - resetCamStuff(); - }); - subStateOpened.add(sub -> { if (Type.getClass(sub) == FreeplayState) { From 6fdc090eccdeab76503918b4810c42114bbbaab5 Mon Sep 17 00:00:00 2001 From: nebulazorua Date: Wed, 8 May 2024 19:53:47 +0800 Subject: [PATCH 17/55] i have accidentally done this and wiped out my chart many times --- source/funkin/play/PlayState.hx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 44ad819c4..c5f76710e 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2549,12 +2549,20 @@ class PlayState extends MusicBeatSubState // Redirect to the chart editor playing the current song. if (controls.DEBUG_CHART) { - disableKeys = true; - persistentUpdate = false; - FlxG.switchState(() -> new ChartEditorState( - { - targetSongId: currentSong.id, - })); + if (isChartingMode) + { + if (FlxG.sound.music != null) FlxG.sound.music.pause(); // Don't reset song position! + PlayState.instance.close(); // This only works because PlayState is a substate! + } + else + { + disableKeys = true; + persistentUpdate = false; + FlxG.switchState(() -> new ChartEditorState( + { + targetSongId: currentSong.id, + })); + } } #end From f5143c2d7859ef51912155243b7411f1ad6d8c1d Mon Sep 17 00:00:00 2001 From: nebulazorua Date: Wed, 8 May 2024 19:56:13 +0800 Subject: [PATCH 18/55] this is better --- source/funkin/play/PlayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index c5f76710e..0ba4e17ec 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2552,7 +2552,7 @@ class PlayState extends MusicBeatSubState if (isChartingMode) { if (FlxG.sound.music != null) FlxG.sound.music.pause(); // Don't reset song position! - PlayState.instance.close(); // This only works because PlayState is a substate! + this.close(); // This only works because PlayState is a substate! } else { From d4f113df59d71fd20ebd49ecadc2bad3cbf4fe8c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 7 May 2024 14:21:22 -0400 Subject: [PATCH 19/55] Fix a conflict between a shader variable name and a function on some graphics cards. --- source/funkin/graphics/shaders/StrokeShader.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/funkin/graphics/shaders/StrokeShader.hx b/source/funkin/graphics/shaders/StrokeShader.hx index fd133ac0a..d110e7de9 100644 --- a/source/funkin/graphics/shaders/StrokeShader.hx +++ b/source/funkin/graphics/shaders/StrokeShader.hx @@ -40,8 +40,8 @@ class StrokeShader extends FlxShader void main() { - vec4 sample = flixel_texture2D(bitmap, openfl_TextureCoordv); - if (sample.a == 0.) { + vec4 gay = flixel_texture2D(bitmap, openfl_TextureCoordv); + if (gay.a == 0.) { float w = size.x / openfl_TextureSize.x; float h = size.y / openfl_TextureSize.y; @@ -49,9 +49,9 @@ class StrokeShader extends FlxShader || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y - h)).a != 0.) - sample = color; + gay = color; } - gl_FragColor = sample; + gl_FragColor = gay; } ') public function new(color:FlxColor = 0xFFFFFFFF, width:Float = 1, height:Float = 1) From 4d1c2c1b8841bdf95ea6107298b3632be86334c1 Mon Sep 17 00:00:00 2001 From: MadBear422 Date: Wed, 8 May 2024 15:30:40 -0700 Subject: [PATCH 20/55] Character selection fix for chart editor. --- .../charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx index eb60cb6db..1edbb6c00 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx @@ -67,7 +67,7 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu var charGrid = new Grid(); charGrid.columns = 5; - charGrid.width = 100; + charGrid.width = this.width; charSelectScroll.addComponent(charGrid); var charIds:Array = CharacterDataParser.listCharacterIds(); From df5bdc7b7db18335a08dab6418c4c193973b7a45 Mon Sep 17 00:00:00 2001 From: codist <50346006+ImCodist@users.noreply.github.com> Date: Wed, 8 May 2024 04:21:30 -0400 Subject: [PATCH 21/55] Fixed stutter once a transition to the main menu completes. --- source/funkin/ui/mainmenu/MainMenuState.hx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/funkin/ui/mainmenu/MainMenuState.hx b/source/funkin/ui/mainmenu/MainMenuState.hx index 466dbbb90..7a21a6e8f 100644 --- a/source/funkin/ui/mainmenu/MainMenuState.hx +++ b/source/funkin/ui/mainmenu/MainMenuState.hx @@ -139,10 +139,6 @@ class MainMenuState extends MusicBeatState resetCamStuff(); - subStateClosed.add(_ -> { - resetCamStuff(); - }); - subStateOpened.add(sub -> { if (Type.getClass(sub) == FreeplayState) { From 54fbb9a29440791c2a5ac80b48ab8e0070c3a9d9 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 8 May 2024 22:45:13 -0400 Subject: [PATCH 22/55] be careful with these gitmodules, we don't want to work out of funkin.art or funkin.assets --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index be5e0aaa8..452c0089b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "assets"] path = assets - url = https://github.com/FunkinCrew/funkin.assets + url = https://github.com/FunkinCrew/Funkin-Assets-secret [submodule "art"] path = art - url = https://github.com/FunkinCrew/funkin.art + url = https://github.com/FunkinCrew/Funkin-Art-secret From 928b3c4119abba963aec6b48cc139ba0e6e7677e Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 8 May 2024 23:29:55 -0400 Subject: [PATCH 23/55] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index ff24bb59b..962130b22 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit ff24bb59b5382677277ae427a164ea4764409f5c +Subproject commit 962130b2243a839106607d08a11599b1857bf8b3 From 4fdc437840949f4558b82b64cc06412c952d27c5 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 8 May 2024 23:55:19 -0400 Subject: [PATCH 24/55] Update Funkin' Debug Hotkeys.md --- docs/Funkin' Debug Hotkeys.md | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/Funkin' Debug Hotkeys.md b/docs/Funkin' Debug Hotkeys.md index c560c5422..1287d5a1b 100644 --- a/docs/Funkin' Debug Hotkeys.md +++ b/docs/Funkin' Debug Hotkeys.md @@ -1,31 +1,31 @@ # Funkin' Debug Hotkeys -`F4` (EVERYWHERE) - Leave Current State and move to Main Menu -`F5` (EVERYWHERE) - Hot Reload Data Files +Most of this functionality is only available on debug builds of the game! -`Y` (Title Screen) - WOAH +## Any State +- `F2`: ***OVERLAY***: Enables the Flixel debug overlay, which has partial support for scripting. +- `F3`: ***SCREENSHOT***: Takes a screenshot of the game and saves it to the local `screenshots` directory. Works outside of debug builds too! +- `F4`: ***EJECT***: Forcibly switch state to the Main Menu (with no extra transition). Useful if you're stuck in a level and you need to get out! +- `F5`: ***HOT RELOAD***: Forcibly reload the game's scripts and data files, then restart the current state. If any files in the `assets` folder have been modified, the game should process the changes for you! NOTE: Known bug, this does not reset song charts or song scripts, but it should reset everything else (such as stage layout data and character animation data). +- `CTRL-SHIFT-L`: ***FORCE CRASH***: Immediately crash the game with a detailed crash log and a stack trace. -`~` (Main Menu) - Access Debug Menu +## **Play State** +- `H`: ***HIDE UI***: Makes the user interface invisible. Works in Pause Menu, great for screenshots. +- `1`: ***END SONG***: Immediately ends the song and moves to Results Screen on Freeplay, or next song on Story Mode. +- `2`: ***GAIN HEALTH***: Debug function, add 10% to the player's health. +- `3`: ***LOSE HEALTH***: Debug function, subtract 5% to the player's health. +- `9`: NEATO! +- `PAGEUP` (MacOS: `Fn-Up`): ***FORWARDS TIME TRAVEL****: Move forward by 2 sections. Hold SHIFT to move forward by 20 sections instead. +- `PAGEDOWN` (MacOS: `Fn-Down`): ***BACKWARDS TIME TRAVEL****: Move backward by 2 sections. Hold SHIFT to move backward by 20 sections instead. -`U` (Play) - Open Stage Editor State -`H` (Play) - Show/Hide HUD -`1` (Play) - End Song -`2` (Play) - Add 10% Health -`3` (Play) - Subtract 5% Health -`7` (Play) - (NOT WORKING) Open Chart Editor -`8` (Play) - Open Animation Editor -`9` (Play) - (Easter Egg) Classic Health Icon -`PGUP`/`Fn+Up` (Play) - Skip Forward In Time -`PGDN`/`Fn+Down` (Play) - 🦃 That's right, we're going to go BACK IN TIME +## **Freeplay State** +- `F` (Freeplay Menu) - Move to Favorites +- `Q` (Freeplay Menu) - Back one category +- `E` (Freeplay Menu) - Forward one category -`F` (Freeplay Menu) - Move to Favorites -`P` (Freeplay Menu) - Switch to Pico (probably doesn't work) -`T` (Freeplay Menu) - Start typing in search bar -`Q` (Freeplay Menu) - Back one letter -`E` (Freeplay Menu) - Forward one letter +## **Title State** +- `Y` - WOAH -`Arrows` (Stage Editor) - Move Prop -`Ctrl-Z` (Stage Editor) - Undo -`Y` (Stage Editor) - Leave Stage Editor - -`H` (Pause Menu) - Hide the Pause Menu UI (good for screenshots!) +## **Main Menu** +- `~`: ***DEBUG****: Opens a menu to access the Chart Editor and other work-in-progress editors. Rebindable in the options menu. +- `CTRL-ALT-SHIFT-W`: ***ALL ACCESS***: Unlocks all songs in Freeplay. Only available on debug builds. From 2e4baa8ab2cc3cea56ba5e235541740348628cce Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 9 May 2024 00:43:33 -0400 Subject: [PATCH 25/55] Fix a null object reference caused by accessing cut assets. --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 962130b22..783f22e74 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 962130b2243a839106607d08a11599b1857bf8b3 +Subproject commit 783f22e741c85223da7f3f815b28fc4c6f240cbc From 4d5c0444c834ad16637d1912f096b733a76152e5 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 9 May 2024 00:46:21 -0400 Subject: [PATCH 26/55] Fix an issue where control binds would be duplicated and quickly multiply. --- source/funkin/input/Controls.hx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/funkin/input/Controls.hx b/source/funkin/input/Controls.hx index 1983d413b..548e4edfa 100644 --- a/source/funkin/input/Controls.hx +++ b/source/funkin/input/Controls.hx @@ -527,6 +527,14 @@ class Controls extends FlxActionSet action.inputs[i].inputID = toAdd; } hasReplaced = true; + } else if (input.device == KEYBOARD && input.inputID == toAdd) { + // This key is already bound! + if (hasReplaced) { + // Remove the duplicate keybind, don't replace. + action.inputs.remove(input); + } else { + hasReplaced = true; + } } } @@ -989,6 +997,7 @@ class Controls extends FlxActionSet for (control in Control.createAll()) { var inputs:Array = Reflect.field(data, control.getName()); + inputs = inputs.unique(); if (inputs != null) { if (inputs.length == 0) { @@ -1038,7 +1047,11 @@ class Controls extends FlxActionSet var inputs = getInputsFor(control, device); isEmpty = isEmpty && inputs.length == 0; - if (inputs.length == 0) inputs = [FlxKey.NONE]; + if (inputs.length == 0) { + inputs = [FlxKey.NONE]; + } else { + inputs = inputs.unique(); + } Reflect.setField(data, control.getName(), inputs); } From bfaa4626f88be1deb3a5af85c2939e3a351b150a Mon Sep 17 00:00:00 2001 From: codist <50346006+ImCodist@users.noreply.github.com> Date: Thu, 9 May 2024 01:10:53 -0400 Subject: [PATCH 27/55] Polish for the transition from GameOverSubState back into PlayState. --- source/funkin/play/PlayState.hx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 44ad819c4..8903a4e63 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -826,6 +826,8 @@ class PlayState extends MusicBeatSubState resetCamera(); + var fromDeathState = isPlayerDying; + persistentUpdate = true; persistentDraw = true; @@ -863,8 +865,11 @@ class PlayState extends MusicBeatSubState if (currentStage != null) currentStage.resetStage(); - playerStrumline.vwooshNotes(); - opponentStrumline.vwooshNotes(); + if (!fromDeathState) + { + playerStrumline.vwooshNotes(); + opponentStrumline.vwooshNotes(); + } playerStrumline.clean(); opponentStrumline.clean(); @@ -1075,6 +1080,22 @@ class PlayState extends MusicBeatSubState function moveToGameOver():Void { + // Reset and update a bunch of values in advance for the transition back from the game over substate. + playerStrumline.clean(); + opponentStrumline.clean(); + + songScore = 0; + updateScoreText(); + + health = Constants.HEALTH_STARTING; + healthLerp = health; + + healthBar.value = healthLerp; + + iconP1.updatePosition(); + iconP2.updatePosition(); + + // Transition to the game over substate. var gameOverSubState = new GameOverSubState( { isChartingMode: isChartingMode, From 985aa1f2a1d31c80c9887f62e35529d5a876ffc7 Mon Sep 17 00:00:00 2001 From: I Gede Hari Kresna Wiyasa Date: Thu, 9 May 2024 15:53:55 +0800 Subject: [PATCH 28/55] Added a fix guide for those with poor internet connection --- docs/COMPILING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/COMPILING.md b/docs/COMPILING.md index 7278e027c..c5096c2f6 100644 --- a/docs/COMPILING.md +++ b/docs/COMPILING.md @@ -5,6 +5,7 @@ 1. Cloning the Repository: Make sure when you clone, you clone the submodules to get the assets repo: - `git clone --recurse-submodules https://github.com/FunkinCrew/funkin.git` - If you accidentally cloned without the `assets` submodule (aka didn't follow the step above), you can run `git submodule update --init --recursive` to get the assets in a foolproof way. + - During the cloning process, you may experience an error along the lines of `error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)` due to poor connectivity. A common fix is to run ` git config --global http.postBuffer 4096M`. 2. Install `hmm` (run `haxelib --global install hmm` and then `haxelib --global run hmm setup`) 3. Install all haxelibs of the current branch by running `hmm install` 4. Setup lime: `haxelib run lime setup` From eeb017b300a0d94cae53368fa8fe3830c8bb619e Mon Sep 17 00:00:00 2001 From: I Gede Hari Kresna Wiyasa Date: Fri, 10 May 2024 10:07:03 +0800 Subject: [PATCH 29/55] moved to Troubleshooting category --- docs/COMPILING.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/COMPILING.md b/docs/COMPILING.md index c5096c2f6..07df6367f 100644 --- a/docs/COMPILING.md +++ b/docs/COMPILING.md @@ -5,7 +5,6 @@ 1. Cloning the Repository: Make sure when you clone, you clone the submodules to get the assets repo: - `git clone --recurse-submodules https://github.com/FunkinCrew/funkin.git` - If you accidentally cloned without the `assets` submodule (aka didn't follow the step above), you can run `git submodule update --init --recursive` to get the assets in a foolproof way. - - During the cloning process, you may experience an error along the lines of `error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)` due to poor connectivity. A common fix is to run ` git config --global http.postBuffer 4096M`. 2. Install `hmm` (run `haxelib --global install hmm` and then `haxelib --global run hmm setup`) 3. Install all haxelibs of the current branch by running `hmm install` 4. Setup lime: `haxelib run lime setup` @@ -19,3 +18,7 @@ - HTML5: Compiles without any extra setup 6. If you are targeting for native, you may need to run `lime rebuild PLATFORM` and `lime rebuild PLATFORM -debug` 7. `lime test PLATFORM` ! Add `-debug` to enable several debug features such as time travel (`PgUp`/`PgDn` in Play State). + +# Troubleshooting + +- During the cloning process, you may experience an error along the lines of `error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)` due to poor connectivity. A common fix is to run ` git config --global http.postBuffer 4096M`. From 4f8a0dbebfdafb37955177d316e82dd26543dd39 Mon Sep 17 00:00:00 2001 From: JugieNoob Date: Sun, 12 May 2024 01:35:04 +0200 Subject: [PATCH 30/55] Fixed Freeplay Scrolling Issue --- source/funkin/ui/freeplay/FreeplayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 7b7543845..b0d435274 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -892,7 +892,7 @@ class FreeplayState extends MusicBeatSubState if (FlxG.mouse.wheel != 0) { dj.resetAFKTimer(); - changeSelection(-Math.round(FlxG.mouse.wheel / 4)); + changeSelection(-Math.round(FlxG.mouse.wheel)); } if (controls.UI_LEFT_P && !FlxG.keys.pressed.CONTROL) From 9d8c6365857d3d7ca99fffa1cc7dcd0cbf782c70 Mon Sep 17 00:00:00 2001 From: gamerbross Date: Sun, 12 May 2024 02:21:39 +0200 Subject: [PATCH 31/55] Add running without compiling VSCode --- .vscode/launch.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 74f72b826..b8fdb64d1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,6 +7,13 @@ "type": "lime", "request": "launch" }, + { + // Launch in native/CPP on Windows/OSX/Linux (without compiling) + "name": "Debug", + "type": "lime", + "request": "launch", + "preLaunchTask": null + }, { // Launch in browser "name": "HTML5 Debug", From b22f09d4daf8784fdf46fec564abac21e20ede3e Mon Sep 17 00:00:00 2001 From: JugieNoob Date: Sun, 12 May 2024 02:21:59 +0200 Subject: [PATCH 32/55] Fixed Scrolling on HTML5 Platforms --- source/funkin/ui/freeplay/FreeplayState.hx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index b0d435274..d4a89531c 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -889,11 +889,24 @@ class FreeplayState extends MusicBeatSubState spamTimer = 0; } + #if !html5 if (FlxG.mouse.wheel != 0) { dj.resetAFKTimer(); changeSelection(-Math.round(FlxG.mouse.wheel)); } + #else + if (FlxG.mouse.wheel < 0) + { + dj.resetAFKTimer(); + changeSelection(-Math.round(FlxG.mouse.wheel / 4)); + } + else if (FlxG.mouse.wheel > 0) + { + dj.resetAFKTimer(); + changeSelection(-Math.round(FlxG.mouse.wheel / 8)); + } + #end if (controls.UI_LEFT_P && !FlxG.keys.pressed.CONTROL) { From 090e4fc6e886093267f612dbe9a1674d4e68518d Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Sun, 12 May 2024 02:42:02 +0200 Subject: [PATCH 33/55] Fixed doing actions when exiting Freeplay menu --- source/funkin/ui/freeplay/FreeplayState.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 7b7543845..52fc32196 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -910,6 +910,7 @@ class FreeplayState extends MusicBeatSubState if (controls.BACK) { + busy = true; FlxTween.globalManager.clear(); FlxTimer.globalManager.clear(); dj.onIntroDone.removeAll(); From 1f8954acad10d0c38ffa83ea736a2a31d596685d Mon Sep 17 00:00:00 2001 From: Noobz4Life Date: Sat, 11 May 2024 21:47:28 -0400 Subject: [PATCH 34/55] bump hxcodec version (fixes linux compilation) --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index a6e4467a9..b9986547a 100644 --- a/hmm.json +++ b/hmm.json @@ -80,7 +80,7 @@ "name": "hxCodec", "type": "git", "dir": null, - "ref": "c0c7f2680cc190c932a549c2e2fdd9b0ba2bd10e", + "ref": "2aa654b974507ab51ab1724d2d97e75726fd7d78", "url": "https://github.com/FunkinCrew/hxCodec" }, { From 42e69c1f73c088b387876d422ac943c126db7986 Mon Sep 17 00:00:00 2001 From: Noobz4Life Date: Sun, 12 May 2024 18:51:21 -0400 Subject: [PATCH 35/55] bump hxcodec version --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index b9986547a..288aa80b8 100644 --- a/hmm.json +++ b/hmm.json @@ -80,7 +80,7 @@ "name": "hxCodec", "type": "git", "dir": null, - "ref": "2aa654b974507ab51ab1724d2d97e75726fd7d78", + "ref": "61b98a7a353b7f529a8fec84ed9afc919a2dffdd", "url": "https://github.com/FunkinCrew/hxCodec" }, { From 7df41ebc56d1dc712564702d9ff0dfe87e2c7009 Mon Sep 17 00:00:00 2001 From: richTrash21 Date: Mon, 13 May 2024 21:35:26 +0400 Subject: [PATCH 36/55] minor optimization --- source/funkin/play/character/BaseCharacter.hx | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/source/funkin/play/character/BaseCharacter.hx b/source/funkin/play/character/BaseCharacter.hx index 2796f8123..4ef86c6a9 100644 --- a/source/funkin/play/character/BaseCharacter.hx +++ b/source/funkin/play/character/BaseCharacter.hx @@ -420,7 +420,8 @@ class BaseCharacter extends Bopper { if (isSinging()) return; - if (['hey', 'cheer'].contains(getCurrentAnimation()) && !isAnimationFinished()) return; + var currentAnimation:String = getCurrentAnimation(); + if ((currentAnimation == 'hey' || currentAnimation == 'cheer') && !isAnimationFinished()) return; } // Prevent dancing while another animation is playing. @@ -441,19 +442,15 @@ class BaseCharacter extends Bopper switch (player) { case 1: - return [ - PlayerSettings.player1.controls.NOTE_LEFT_P, - PlayerSettings.player1.controls.NOTE_DOWN_P, - PlayerSettings.player1.controls.NOTE_UP_P, - PlayerSettings.player1.controls.NOTE_RIGHT_P, - ].contains(true); + return PlayerSettings.player1.controls.NOTE_LEFT_P + || PlayerSettings.player1.controls.NOTE_DOWN_P + || PlayerSettings.player1.controls.NOTE_UP_P + || PlayerSettings.player1.controls.NOTE_RIGHT_P; case 2: - return [ - PlayerSettings.player2.controls.NOTE_LEFT_P, - PlayerSettings.player2.controls.NOTE_DOWN_P, - PlayerSettings.player2.controls.NOTE_UP_P, - PlayerSettings.player2.controls.NOTE_RIGHT_P, - ].contains(true); + return PlayerSettings.player2.controls.NOTE_LEFT_P + || PlayerSettings.player2.controls.NOTE_DOWN_P + || PlayerSettings.player2.controls.NOTE_UP_P + || PlayerSettings.player2.controls.NOTE_RIGHT_P; } return false; } @@ -469,19 +466,15 @@ class BaseCharacter extends Bopper switch (player) { case 1: - return [ - PlayerSettings.player1.controls.NOTE_LEFT, - PlayerSettings.player1.controls.NOTE_DOWN, - PlayerSettings.player1.controls.NOTE_UP, - PlayerSettings.player1.controls.NOTE_RIGHT, - ].contains(true); + return PlayerSettings.player1.controls.NOTE_LEFT + || PlayerSettings.player1.controls.NOTE_DOWN + || PlayerSettings.player1.controls.NOTE_UP + || PlayerSettings.player1.controls.NOTE_RIGHT; case 2: - return [ - PlayerSettings.player2.controls.NOTE_LEFT, - PlayerSettings.player2.controls.NOTE_DOWN, - PlayerSettings.player2.controls.NOTE_UP, - PlayerSettings.player2.controls.NOTE_RIGHT, - ].contains(true); + return PlayerSettings.player2.controls.NOTE_LEFT + || PlayerSettings.player2.controls.NOTE_DOWN + || PlayerSettings.player2.controls.NOTE_UP + || PlayerSettings.player2.controls.NOTE_RIGHT; } return false; } From 4e935b47c66112239ac2c1ddf660ff9cfe08ee79 Mon Sep 17 00:00:00 2001 From: lemz Date: Tue, 14 May 2024 00:04:45 +0200 Subject: [PATCH 37/55] Update LoadingState.hx --- source/funkin/ui/transition/LoadingState.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx index 28533e35b..9ac34465c 100644 --- a/source/funkin/ui/transition/LoadingState.hx +++ b/source/funkin/ui/transition/LoadingState.hx @@ -162,7 +162,8 @@ class LoadingState extends MusicBeatSubState { targetShit = FlxMath.remapToRange(callbacks.numRemaining / callbacks.length, 1, 0, 0, 1); - loadBar.scale.x = FlxMath.lerp(loadBar.scale.x, targetShit, 0.50); + loadBar.setGraphicSize(Std.int(FlxG.width * targetShit), loadBar.height); + loadBar.updateHitbox(); FlxG.watch.addQuick('percentage?', callbacks.numRemaining / callbacks.length); } From 259df760bc8d4eb3131b06d106b1ebee0493a7d3 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 13 May 2024 21:06:41 -0400 Subject: [PATCH 38/55] re-add lerp to load screen --- source/funkin/ui/transition/LoadingState.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx index 9ac34465c..95c378b24 100644 --- a/source/funkin/ui/transition/LoadingState.hx +++ b/source/funkin/ui/transition/LoadingState.hx @@ -162,7 +162,8 @@ class LoadingState extends MusicBeatSubState { targetShit = FlxMath.remapToRange(callbacks.numRemaining / callbacks.length, 1, 0, 0, 1); - loadBar.setGraphicSize(Std.int(FlxG.width * targetShit), loadBar.height); + var lerpWidth:Int = Std.int(FlxMath.lerp(loadBar.width, FlxG.width * targetShit, 0.2)); + loadBar.setGraphicSize(lerpWidth, loadBar.height); loadBar.updateHitbox(); FlxG.watch.addQuick('percentage?', callbacks.numRemaining / callbacks.length); } From be5756410000a98875f467507b2cf8fdcd83d288 Mon Sep 17 00:00:00 2001 From: TechnikTil <89487150+TechnikTil@users.noreply.github.com> Date: Tue, 14 May 2024 12:32:50 -0600 Subject: [PATCH 39/55] ludum dare 47 typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62794b924..4c6fd9e84 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Friday Night Funkin' -Friday Night Funkin' is a rhythm game. Built using HaxeFlixel for Ludem Dare 47. +Friday Night Funkin' is a rhythm game. Built using HaxeFlixel for Ludum Dare 47. This game was made with love to Newgrounds and it's community. Extra love to Tom Fulp. From 2434f6438146b5bfbb224c6a6c98cf8d932ecdc1 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 14 May 2024 21:21:47 -0400 Subject: [PATCH 40/55] web fix for scroll --- assets | 2 +- source/funkin/ui/freeplay/FreeplayState.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets b/assets index 783f22e74..962130b22 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 783f22e741c85223da7f3f815b28fc4c6f240cbc +Subproject commit 962130b2243a839106607d08a11599b1857bf8b3 diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index a3726e025..1c7926f62 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -899,7 +899,7 @@ class FreeplayState extends MusicBeatSubState if (FlxG.mouse.wheel < 0) { dj.resetAFKTimer(); - changeSelection(-Math.round(FlxG.mouse.wheel / 4)); + changeSelection(-Math.round(FlxG.mouse.wheel / 8)); } else if (FlxG.mouse.wheel > 0) { From 41686dce9e739783dfb98025b44427d12079a2be Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 14 May 2024 21:22:17 -0400 Subject: [PATCH 41/55] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 962130b22..783f22e74 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 962130b2243a839106607d08a11599b1857bf8b3 +Subproject commit 783f22e741c85223da7f3f815b28fc4c6f240cbc From ac06c2357735f90825586ccccd02a555d76e26ec Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 14 May 2024 21:41:42 -0400 Subject: [PATCH 42/55] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 783f22e74..962130b22 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 783f22e741c85223da7f3f815b28fc4c6f240cbc +Subproject commit 962130b2243a839106607d08a11599b1857bf8b3 From 4e6d980447cacc5cda32d74320b833593cb8e045 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 14 May 2024 22:10:13 -0400 Subject: [PATCH 43/55] 0.3.3 changelog --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f830047..2f0a0dcff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.3] - 2024-05-14 +### Changed +- Cleaned up some code in `PlayAnimationSongEvent.hx` (thanks BurgerBalls!) +### Fixed +- Fix Web Loading Bar (thanks lemz1!) +- Don't allow any more inputs when exiting freeplay (thanks gamerbros!) +- Fixed using mouse wheel to scroll on freeplay (thanks JugieNoob!) +- Fixed the reset's of the health icons, score, and notes when re-entering gameplay from gameover (thanks ImCodist!) +- Fixed the chart editor character selector's hitbox width (thanks MadBear422!) +- Fixed camera stutter once a wipe transition to the Main Menu completes (thanks ImCodist!) +- Fixed an issue where hold note would be invisible for a single frame (thanks ImCodist!) +- Fix tween accumulation on title screen when pressing Y multiple times (thanks TheGaloXx!) +- Fix for a game over easter egg so you don't accidentally exit it when viewing + ## [0.3.2] - 2024-05-03 ### Added - Added `,` and `.` keybinds to the Chart Editor. These place Focus Camera events at the playhead, for the opponent and player respectively. From 1a8706b0315ca0728536080cff49934a27e4861b Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 14 May 2024 22:11:57 -0400 Subject: [PATCH 44/55] project.xml version bump --- Project.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.xml b/Project.xml index fcfcfb9f3..24cdac270 100644 --- a/Project.xml +++ b/Project.xml @@ -1,7 +1,7 @@ - + From e724373563564b7c68d3c8dbff4db48985b36b44 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 14 May 2024 22:16:57 -0400 Subject: [PATCH 45/55] more changeloggy --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0a0dcff..a852ca82d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an issue where hold note would be invisible for a single frame (thanks ImCodist!) - Fix tween accumulation on title screen when pressing Y multiple times (thanks TheGaloXx!) - Fix for a game over easter egg so you don't accidentally exit it when viewing +- Fix a crash when querying FlxG.state in the crash handler +- Fix an issue where the Freeplay menu never displays 100% clear +- Chart debug key now properly returns you to the previous chart editor session if you were playtesting a chart (thanks nebulazorua!) +- Hopefully fixed Freeplay crashes on AMD gpu's ## [0.3.2] - 2024-05-03 ### Added From 28bee8397e4ee18bcc75e775ebec4e4bd20db151 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 14 May 2024 23:19:02 -0400 Subject: [PATCH 46/55] git submodules trolled --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 452c0089b..be5e0aaa8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "assets"] path = assets - url = https://github.com/FunkinCrew/Funkin-Assets-secret + url = https://github.com/FunkinCrew/funkin.assets [submodule "art"] path = art - url = https://github.com/FunkinCrew/Funkin-Art-secret + url = https://github.com/FunkinCrew/funkin.art From f21cff86be0d2ef57713d4fa8a09e2634d22e54a Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 14 May 2024 23:29:09 -0400 Subject: [PATCH 47/55] asset submod grr... --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 962130b22..783f22e74 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 962130b2243a839106607d08a11599b1857bf8b3 +Subproject commit 783f22e741c85223da7f3f815b28fc4c6f240cbc From f1a0692c51335f7d5ccf4236b3775f55fef7cd86 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Wed, 15 May 2024 22:50:34 +0200 Subject: [PATCH 48/55] Fix ChartingState GameOver Crashes --- source/funkin/play/GameOverSubState.hx | 3 +++ source/funkin/play/PlayState.hx | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/GameOverSubState.hx b/source/funkin/play/GameOverSubState.hx index c3abbcf3e..4d50d75cc 100644 --- a/source/funkin/play/GameOverSubState.hx +++ b/source/funkin/play/GameOverSubState.hx @@ -162,6 +162,8 @@ class GameOverSubState extends MusicBeatSubState @:nullSafety(Off) function setCameraTarget():Void { + if (PlayState.instance.isMinimalMode || boyfriend == null) return; + // Assign a camera follow point to the boyfriend's position. cameraFollowPoint = new FlxObject(PlayState.instance.cameraFollowPoint.x, PlayState.instance.cameraFollowPoint.y, 1, 1); cameraFollowPoint.x = boyfriend.getGraphicMidpoint().x; @@ -254,6 +256,7 @@ class GameOverSubState extends MusicBeatSubState this.close(); if (FlxG.sound.music != null) FlxG.sound.music.pause(); // Don't reset song position! PlayState.instance.close(); // This only works because PlayState is a substate! + return; } else if (PlayStatePlaylist.isStoryMode) { diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index a9ca09ce8..43dd485cf 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1092,8 +1092,11 @@ class PlayState extends MusicBeatSubState healthBar.value = healthLerp; - iconP1.updatePosition(); - iconP2.updatePosition(); + if (!isMinimalMode) + { + iconP1.updatePosition(); + iconP2.updatePosition(); + } // Transition to the game over substate. var gameOverSubState = new GameOverSubState( From 85b9de1de937b29863e3a3ff92542b1218cf99e4 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Fri, 17 May 2024 23:53:43 +0200 Subject: [PATCH 49/55] Allow Volume Keys while watching Toy Commercial (AttractState) --- source/funkin/ui/title/AttractState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/ui/title/AttractState.hx b/source/funkin/ui/title/AttractState.hx index 3ecb756df..c5a3d0504 100644 --- a/source/funkin/ui/title/AttractState.hx +++ b/source/funkin/ui/title/AttractState.hx @@ -89,7 +89,7 @@ class AttractState extends MusicBeatState super.update(elapsed); // If the user presses any button, skip the video. - if (FlxG.keys.justPressed.ANY) + if (FlxG.keys.justPressed.ANY && !controls.VOLUME_MUTE && !controls.VOLUME_UP && !controls.VOLUME_DOWN) { onAttractEnd(); } From 6b42da09026d4c50eecff357cc2557c3f0ff9312 Mon Sep 17 00:00:00 2001 From: SanicBTW <58010536+SanicBTW@users.noreply.github.com> Date: Sat, 18 May 2024 09:04:27 +0200 Subject: [PATCH 50/55] Keep the consistency in Conductor --- source/funkin/Conductor.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/funkin/Conductor.hx b/source/funkin/Conductor.hx index 0d63cb6cc..e73b2860c 100644 --- a/source/funkin/Conductor.hx +++ b/source/funkin/Conductor.hx @@ -430,7 +430,7 @@ class Conductor else if (currentTimeChange != null && this.songPosition > 0.0) { // roundDecimal prevents representing 8 as 7.9999999 - this.currentStepTime = FlxMath.roundDecimal((currentTimeChange.beatTime * 4) + (this.songPosition - currentTimeChange.timeStamp) / stepLengthMs, 6); + this.currentStepTime = FlxMath.roundDecimal((currentTimeChange.beatTime * Constants.STEPS_PER_BEAT) + (this.songPosition - currentTimeChange.timeStamp) / stepLengthMs, 6); this.currentBeatTime = currentStepTime / Constants.STEPS_PER_BEAT; this.currentMeasureTime = currentStepTime / stepsPerMeasure; this.currentStep = Math.floor(currentStepTime); @@ -564,7 +564,7 @@ class Conductor if (ms >= timeChange.timeStamp) { lastTimeChange = timeChange; - resultStep = lastTimeChange.beatTime * 4; + resultStep = lastTimeChange.beatTime * Constants.STEPS_PER_BEAT; } else { @@ -600,7 +600,7 @@ class Conductor var lastTimeChange:SongTimeChange = timeChanges[0]; for (timeChange in timeChanges) { - if (stepTime >= timeChange.beatTime * 4) + if (stepTime >= timeChange.beatTime * Constants.STEPS_PER_BEAT) { lastTimeChange = timeChange; resultMs = lastTimeChange.timeStamp; @@ -613,7 +613,7 @@ class Conductor } var lastStepLengthMs:Float = ((Constants.SECS_PER_MIN / lastTimeChange.bpm) * Constants.MS_PER_SEC) / timeSignatureNumerator; - resultMs += (stepTime - lastTimeChange.beatTime * 4) * lastStepLengthMs; + resultMs += (stepTime - lastTimeChange.beatTime * Constants.STEPS_PER_BEAT) * lastStepLengthMs; return resultMs; } From 6cb58163787b6951fa6fffed01a48e444cd5b5f5 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 21 May 2024 02:49:07 -0400 Subject: [PATCH 51/55] Add freeplay favorites to the save data so they persist between sessions. --- source/funkin/input/Controls.hx | 2 +- source/funkin/save/Save.hx | 44 ++++++++++++++++++++-- source/funkin/save/changelog.md | 3 ++ source/funkin/ui/freeplay/FreeplayState.hx | 25 +++++++++++- 4 files changed, 68 insertions(+), 6 deletions(-) diff --git a/source/funkin/input/Controls.hx b/source/funkin/input/Controls.hx index 1983d413b..cede0b688 100644 --- a/source/funkin/input/Controls.hx +++ b/source/funkin/input/Controls.hx @@ -707,7 +707,7 @@ class Controls extends FlxActionSet case Control.VOLUME_UP: return [PLUS, NUMPADPLUS]; case Control.VOLUME_DOWN: return [MINUS, NUMPADMINUS]; case Control.VOLUME_MUTE: return [ZERO, NUMPADZERO]; - case Control.FULLSCREEN: return [FlxKey.F]; + case Control.FULLSCREEN: return [FlxKey.F11]; // We use F for other things LOL. } case Duo(true): diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index acbe59edd..7b2d3f511 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -14,8 +14,7 @@ import funkin.util.SerializerUtil; @:nullSafety class Save { - // Version 2.0.2 adds attributes to `optionsChartEditor`, that should return default values if they are null. - public static final SAVE_DATA_VERSION:thx.semver.Version = "2.0.3"; + public static final SAVE_DATA_VERSION:thx.semver.Version = "2.0.4"; public static final SAVE_DATA_VERSION_RULE:thx.semver.VersionRule = "2.0.x"; // We load this version's saves from a new save path, to maintain SOME level of backwards compatibility. @@ -53,7 +52,8 @@ class Save public function new(?data:RawSaveData) { if (data == null) this.data = Save.getDefault(); - else this.data = data; + else + this.data = data; } public static function getDefault():RawSaveData @@ -77,6 +77,9 @@ class Save levels: [], songs: [], }, + + favoriteSongs: [], + options: { // Reasonable defaults. @@ -554,6 +557,35 @@ class Save return false; } + public function isSongFavorited(id:String):Bool + { + if (data.favoriteSongs == null) + { + data.favoriteSongs = []; + flush(); + }; + + return data.favoriteSongs.contains(id); + } + + public function favoriteSong(id:String):Void + { + if (!isSongFavorited(id)) + { + data.favoriteSongs.push(id); + flush(); + } + } + + public function unfavoriteSong(id:String):Void + { + if (isSongFavorited(id)) + { + data.favoriteSongs.remove(id); + flush(); + } + } + public function getControls(playerId:Int, inputType:Device):Null { switch (inputType) @@ -740,6 +772,12 @@ typedef RawSaveData = */ var options:SaveDataOptions; + /** + * The user's favorited songs in the Freeplay menu, + * as a list of song IDs. + */ + var favoriteSongs:Array; + var mods:SaveDataMods; /** diff --git a/source/funkin/save/changelog.md b/source/funkin/save/changelog.md index 3fa9839d1..7c9094f2d 100644 --- a/source/funkin/save/changelog.md +++ b/source/funkin/save/changelog.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.4] - 2024-05-21 +### Added +- `favoriteSongs:Array` to `Save` ## [2.0.3] - 2024-01-09 ### Added diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 239068288..911d07a56 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -699,8 +699,8 @@ class FreeplayState extends MusicBeatSubState if (targetSong != null) { var realShit:Int = curSelected; - targetSong.isFav = !targetSong.isFav; - if (targetSong.isFav) + var isFav = targetSong.toggleFavorite(); + if (isFav) { FlxTween.tween(grpCapsules.members[realShit], {angle: 360}, 0.4, { @@ -1398,11 +1398,32 @@ class FreeplaySongData this.levelId = levelId; this.songId = songId; this.song = song; + + this.isFav = Save.instance.isSongFavorited(songId); + if (displayedVariations != null) this.displayedVariations = displayedVariations; updateValues(displayedVariations); } + /** + * Toggle whether or not the song is favorited, then flush to save data. + * @return Whether or not the song is now favorited. + */ + public function toggleFavorite():Bool + { + isFav = !isFav; + if (isFav) + { + Save.instance.favoriteSong(this.songId); + } + else + { + Save.instance.unfavoriteSong(this.songId); + } + return isFav; + } + function updateValues(variations:Array):Void { this.songDifficulties = song.listDifficulties(variations, false, false); From f17f6393041a54e4b15418059f6a9ff9dc2a39cb Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 22 May 2024 01:07:20 -0400 Subject: [PATCH 52/55] Finish implementing smaller numbers. --- assets | 2 +- source/funkin/InitState.hx | 4 +- source/funkin/play/ResultState.hx | 75 ++++++++++++++++--- .../play/components/ClearPercentCounter.hx | 73 ++++++++++++++---- 4 files changed, 124 insertions(+), 30 deletions(-) diff --git a/assets b/assets index ce7dabffb..b6d930109 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit ce7dabffbebc154c9dda1f01e92dbef83e3405ab +Subproject commit b6d930109eb69cfd368145e893d81ac1e97ed004 diff --git a/source/funkin/InitState.hx b/source/funkin/InitState.hx index 6a52eaf5d..d17554d11 100644 --- a/source/funkin/InitState.hx +++ b/source/funkin/InitState.hx @@ -227,14 +227,14 @@ class InitState extends FlxState tallies: { sick: 130, - good: 69, + good: 70, bad: 69, shit: 69, missed: 69, combo: 69, maxCombo: 69, totalNotesHit: 140, - totalNotes: 2000, + totalNotes: 200 // 0, } }, })); diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index d038b7785..fdcd0cc39 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -37,6 +37,7 @@ class ResultState extends MusicBeatSubState final rank:ResultRank; final songName:FlxBitmapText; final difficulty:FlxSprite; + final clearPercentSmall:ClearPercentCounter; final maskShaderSongName:LeftMaskShader = new LeftMaskShader(); final maskShaderDifficulty:LeftMaskShader = new LeftMaskShader(); @@ -78,6 +79,10 @@ class ResultState extends MusicBeatSubState difficulty = new FlxSprite(555); difficulty.zIndex = 1000; + clearPercentSmall = new ClearPercentCounter(FlxG.width / 2 + 300, FlxG.height / 2 - 100, 100, true); + clearPercentSmall.zIndex = 1000; + clearPercentSmall.visible = false; + bgFlash = FlxGradient.createGradientFlxSprite(FlxG.width, FlxG.height, [0xFFFFEB69, 0xFFFFE66A], 90); resultsAnim = FunkinSprite.createSparrow(-200, -10, "resultScreen/results"); @@ -194,7 +199,7 @@ class ResultState extends MusicBeatSubState speedOfTween.x = -1.0 * Math.cos(angleRad); speedOfTween.y = -1.0 * Math.sin(angleRad); - timerThenSongName(1.0); + timerThenSongName(1.0, false); songName.shader = maskShaderSongName; difficulty.shader = maskShaderDifficulty; @@ -319,13 +324,15 @@ class ResultState extends MusicBeatSubState function startRankTallySequence():Void { - clearPercentTarget = Math.floor((params.scoreData.tallies.sick + params.scoreData.tallies.good) / params.scoreData.tallies.totalNotes * 100); - clearPercentTarget = 100; + var clearPercentFloat = (params.scoreData.tallies.sick + params.scoreData.tallies.good) / params.scoreData.tallies.totalNotes * 100; + clearPercentTarget = Math.floor(clearPercentFloat); + // Prevent off-by-one errors. clearPercentLerp = Std.int(Math.max(0, clearPercentTarget - 36)); - var clearPercentCounter:ClearPercentCounter = new ClearPercentCounter(FlxG.width / 2 + 300, FlxG.height / 2 - 100, clearPercentTarget); - clearPercentCounter.curNumber = clearPercentLerp; + trace('Clear percent target: ' + clearPercentFloat + ', round: ' + clearPercentTarget); + + var clearPercentCounter:ClearPercentCounter = new ClearPercentCounter(FlxG.width / 2 + 300, FlxG.height / 2 - 100, clearPercentLerp); FlxTween.tween(clearPercentCounter, {curNumber: clearPercentTarget}, 1.5, { ease: FlxEase.quartOut, @@ -345,10 +352,25 @@ class ResultState extends MusicBeatSubState bgFlash.visible = true; FlxTween.tween(bgFlash, {alpha: 0}, 0.4); + // Just to be sure that the lerp didn't mess things up. + clearPercentCounter.curNumber = clearPercentTarget; + + clearPercentCounter.flash(true); + new FlxTimer().start(0.4, _ -> { + clearPercentCounter.flash(false); + }); + displayRankText(); new FlxTimer().start(2.0, _ -> { - // remove(clearPercentCounter); + FlxTween.tween(clearPercentCounter, {alpha: 0}, 0.5, + { + startDelay: 0.5, + ease: FlxEase.quartOut, + onComplete: _ -> { + remove(clearPercentCounter); + } + }); afterRankTallySequence(); }); @@ -406,6 +428,8 @@ class ResultState extends MusicBeatSubState function afterRankTallySequence():Void { + showSmallClearPercent(); + FunkinSound.playMusic(rank.getMusicPath(), { startingVolume: 1.0, @@ -490,7 +514,7 @@ class ResultState extends MusicBeatSubState } } - function timerThenSongName(timerLength:Float = 3.0):Void + function timerThenSongName(timerLength:Float = 3.0, autoScroll:Bool = true):Void { movingSongStuff = false; @@ -501,10 +525,17 @@ class ResultState extends MusicBeatSubState difficulty.y = -difficulty.height; FlxTween.tween(difficulty, {y: diffYTween}, 0.5, {ease: FlxEase.expoOut, startDelay: 0.8}); + if (clearPercentSmall != null) + { + clearPercentSmall.x = (difficulty.x + difficulty.width) + 60; + clearPercentSmall.y = -clearPercentSmall.height; + FlxTween.tween(clearPercentSmall, {y: 122 - 5}, 0.5, {ease: FlxEase.expoOut, startDelay: 0.8}); + } + songName.y = -songName.height; var fuckedupnumber = (10) * (songName.text.length / 15); - FlxTween.tween(songName, {y: diffYTween - 35 - fuckedupnumber}, 0.5, {ease: FlxEase.expoOut, startDelay: 0.9}); - songName.x = (difficulty.x + difficulty.width) + 20; + FlxTween.tween(songName, {y: diffYTween - 25 - fuckedupnumber}, 0.5, {ease: FlxEase.expoOut, startDelay: 0.9}); + songName.x = clearPercentSmall.x + clearPercentSmall.width - 30; new FlxTimer().start(timerLength, _ -> { var tempSpeed = FlxPoint.get(speedOfTween.x, speedOfTween.y); @@ -512,10 +543,29 @@ class ResultState extends MusicBeatSubState speedOfTween.set(0, 0); FlxTween.tween(speedOfTween, {x: tempSpeed.x, y: tempSpeed.y}, 0.7, {ease: FlxEase.quadIn}); - movingSongStuff = true; + movingSongStuff = (autoScroll); }); } + function showSmallClearPercent():Void + { + if (clearPercentSmall != null) + { + add(clearPercentSmall); + clearPercentSmall.visible = true; + clearPercentSmall.flash(true); + new FlxTimer().start(0.4, _ -> { + clearPercentSmall.flash(false); + }); + + clearPercentSmall.curNumber = clearPercentTarget; + clearPercentSmall.zIndex = 1000; + refresh(); + } + + movingSongStuff = true; + } + var movingSongStuff:Bool = false; var speedOfTween:FlxPoint = FlxPoint.get(-1, 1); @@ -523,7 +573,8 @@ class ResultState extends MusicBeatSubState { super.draw(); - songName.clipRect = FlxRect.get(Math.max(0, 540 - songName.x), 0, FlxG.width, songName.height); + songName.clipRect = FlxRect.get(Math.max(0, 520 - songName.x), 0, FlxG.width, songName.height); + // PROBABLY SHOULD FIX MEMORY FREE OR WHATEVER THE PUT() FUNCTION DOES !!!! FEELS LIKE IT STUTTERS!!! // if (songName != null && songName.frame != null) @@ -539,8 +590,10 @@ class ResultState extends MusicBeatSubState { songName.x += speedOfTween.x; difficulty.x += speedOfTween.x; + clearPercentSmall.x += speedOfTween.x; songName.y += speedOfTween.y; difficulty.y += speedOfTween.y; + clearPercentSmall.y += speedOfTween.y; if (songName.x + songName.width < 100) { diff --git a/source/funkin/play/components/ClearPercentCounter.hx b/source/funkin/play/components/ClearPercentCounter.hx index 4c03ec3a9..d296b0b0b 100644 --- a/source/funkin/play/components/ClearPercentCounter.hx +++ b/source/funkin/play/components/ClearPercentCounter.hx @@ -1,6 +1,7 @@ package funkin.play.components; import funkin.graphics.FunkinSprite; +import funkin.graphics.shaders.PureColor; import flixel.FlxSprite; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup; @@ -9,25 +10,54 @@ import flixel.tweens.FlxEase; import flixel.tweens.FlxTween; import flixel.text.FlxText.FlxTextAlign; import funkin.util.MathUtil; +import flixel.util.FlxColor; /** * Numerical counters used to display the clear percent. */ class ClearPercentCounter extends FlxTypedSpriteGroup { - public var curNumber:Int = 0; - public var neededNumber:Int = 0; + public var curNumber(default, set):Int = 0; - public function new(x:Float, y:Float, neededNumber:Int = 0) + var numberChanged:Bool = false; + + function set_curNumber(val:Int):Int + { + numberChanged = true; + return curNumber = val; + } + + var small:Bool = false; + var flashShader:PureColor; + + public function new(x:Float, y:Float, startingNumber:Int = 0, small:Bool = false) { super(x, y); - this.neededNumber = neededNumber; + flashShader = new PureColor(FlxColor.WHITE); + flashShader.colorSet = true; - var clearPercentText:FunkinSprite = FunkinSprite.create(0, 0, 'resultScreen/clearPercent/clearPercentText'); + curNumber = startingNumber; + + this.small = small; + + var clearPercentText:FunkinSprite = FunkinSprite.create(0, 0, 'resultScreen/clearPercent/clearPercentText${small ? 'Small' : ''}'); + clearPercentText.x = small ? 40 : 0; add(clearPercentText); - if (curNumber == neededNumber) drawNumbers(); + drawNumbers(); + } + + /** + * Make the counter flash turn white or stop being all white. + * @param enabled Whether the counter should be white. + */ + public function flash(enabled:Bool):Void + { + for (member in members) + { + member.shader = enabled ? flashShader : null; + } } var tmr:Float = 0; @@ -36,7 +66,7 @@ class ClearPercentCounter extends FlxTypedSpriteGroup { super.update(elapsed); - if (curNumber < neededNumber) drawNumbers(); + if (numberChanged) drawNumbers(); } function drawNumbers() @@ -44,8 +74,6 @@ class ClearPercentCounter extends FlxTypedSpriteGroup var seperatedScore:Array = []; var tempCombo:Int = Math.round(curNumber); - var fullNumberDigits:Int = Std.int(Math.max(1, Math.ceil(MathUtil.logBase(10, neededNumber)))); - while (tempCombo != 0) { seperatedScore.push(tempCombo % 10); @@ -59,19 +87,32 @@ class ClearPercentCounter extends FlxTypedSpriteGroup for (ind => num in seperatedScore) { var digitIndex = ind + 1; + // If there's only one digit, move it to the right + // If there's three digits, move them all to the left + var digitOffset = (seperatedScore.length == 1) ? 1 : (seperatedScore.length == 3) ? -1 : 0; + var digitSize = small ? 32 : 72; + var digitHeightOffset = small ? -4 : 0; + + var xPos = (digitIndex - 1 + digitOffset) * (digitSize * this.scale.x); + xPos += small ? -24 : 0; + var yPos = (digitIndex - 1 + digitOffset) * (digitHeightOffset * this.scale.y); + yPos += small ? 0 : 72; + if (digitIndex >= members.length) { - var xPos = (digitIndex - 1) * (72 * this.scale.x); - var yPos = 72; - // Three digits = LRL so two different numbers aren't adjacent to each other. - var variant:Bool = (fullNumberDigits % 2 != 0) ? (digitIndex % 2 == 0) : (digitIndex % 2 == 1); - var numb:ClearPercentNumber = new ClearPercentNumber(xPos, yPos, num); + // Three digits = LLR because the 1 and 0 won't be the same anyway. + var variant:Bool = (seperatedScore.length == 3) ? (digitIndex >= 2) : (digitIndex >= 1); + // var variant:Bool = (seperatedScore.length % 2 != 0) ? (digitIndex % 2 == 0) : (digitIndex % 2 == 1); + var numb:ClearPercentNumber = new ClearPercentNumber(xPos, yPos, num, variant, this.small); numb.scale.set(this.scale.x, this.scale.y); add(numb); } else { members[digitIndex].animation.play(Std.string(num)); + // Reset the position of the number + members[digitIndex].x = xPos + this.x; + members[digitIndex].y = yPos + this.y; } } } @@ -79,11 +120,11 @@ class ClearPercentCounter extends FlxTypedSpriteGroup class ClearPercentNumber extends FlxSprite { - public function new(x:Float, y:Float, digit:Int, variant:Bool = false) + public function new(x:Float, y:Float, digit:Int, variant:Bool, small:Bool) { super(x, y); - frames = Paths.getSparrowAtlas('resultScreen/clearPercent/clearPercentNumber${variant ? 'Right' : 'Left'}'); + frames = Paths.getSparrowAtlas('resultScreen/clearPercent/clearPercentNumber${small ? 'Small' : variant ? 'Right' : 'Left'}'); for (i in 0...10) { From 44880fa5697ddf16a62211cd4089d63371acaf46 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 24 May 2024 00:06:26 -0400 Subject: [PATCH 53/55] Implement placeholder GREAT animation --- source/funkin/InitState.hx | 2 +- source/funkin/play/ResultState.hx | 29 +++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/source/funkin/InitState.hx b/source/funkin/InitState.hx index d17554d11..a945c10c5 100644 --- a/source/funkin/InitState.hx +++ b/source/funkin/InitState.hx @@ -227,7 +227,7 @@ class InitState extends FlxState tallies: { sick: 130, - good: 70, + good: 25, bad: 69, shit: 69, missed: 69, diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index fdcd0cc39..ee7c8eade 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -53,6 +53,7 @@ class ResultState extends MusicBeatSubState var bfPerfect:Null = null; var bfExcellent:Null = null; + var bfGreat:Null = null; var bfGood:Null = null; var gfGood:Null = null; var bfShit:Null = null; @@ -151,7 +152,20 @@ class ResultState extends MusicBeatSubState } }); - case GOOD | GREAT: + case GREAT: + bfGreat = new FlxAtlasSprite(640, 200, Paths.animateAtlas("resultScreen/results-bf/resultsGREAT", "shared")); + bfGreat.visible = false; + bfGreat.zIndex = 500; + add(bfGreat); + + bfGreat.onAnimationFinish.add((animName) -> { + if (bfGreat != null) + { + bfGreat.playAnimation('Loop Start'); + } + }); + + case GOOD: gfGood = FunkinSprite.createSparrow(625, 325, 'resultScreen/results-bf/resultsGOOD/resultGirlfriendGOOD'); gfGood.animation.addByPrefix("clap", "Girlfriend Good Anim", 24, false); gfGood.visible = false; @@ -476,6 +490,17 @@ class ResultState extends MusicBeatSubState bfExcellent.playAnimation('Intro'); } + case GREAT: + if (bfGreat == null) + { + trace("Could not build GREAT animation!"); + } + else + { + bfGreat.visible = true; + bfGreat.playAnimation('Intro'); + } + case SHIT: if (bfShit == null) { @@ -487,7 +512,7 @@ class ResultState extends MusicBeatSubState bfShit.playAnimation('Intro'); } - case GREAT | GOOD: + case GOOD: if (bfGood == null) { trace("Could not build GOOD animation!"); From 2db99b3cb41bef826bd3a286ac0d942476dc5eee Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 24 May 2024 00:06:52 -0400 Subject: [PATCH 54/55] Update submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index b6d930109..2a57e3406 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit b6d930109eb69cfd368145e893d81ac1e97ed004 +Subproject commit 2a57e34061f6034236663851332319c5dedab259 From 62e04b3372fe1b9f7256585a23ed38a5b51db98f Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 24 May 2024 13:24:11 -0400 Subject: [PATCH 55/55] Update Changelog --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f830047..10bbfe5f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,46 @@ All notable changes will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.4.0] - 2024-05-?? +### Added +- 2 new Erect remixes, Eggnog and Satin Panties. Check them out from +- Improvements to the Freeplay screen, with song difficulty ratings and player rank displays. +- Reworked the Results screen, with additional animations and audio based on your performance. +- Added a Charter field to the chart format, to allow for crediting the creator of a level's chart. + - You can see who charted a song from the Pause menu. +### Changed +- Tweaked the charts for several songs: + - Winter Horrorland + - Stress + - Lit Up +- Custom note styles are now properly supported for songs; add new notestyles via JSON, then select it for use from the Chart Editor Metadata toolbox. (thanks Keoiki!) +- Health icons now support a Winning frame without requiring a spritesheet, simply include a third frame in the icon file. (thanks gamerbross!) + - Remember that for more complex behaviors such as animations or transitions, you should use an XML file to define each frame. +### Fixed +- Fixed a bug where pressing the volume keys would stop the Toy commercial (thanks gamerbross!) +- Fixed a bug where the Chart Editor would crash when losing (thanks gamerbross!) +- Made improvements to compiling documentation (thanks gedehari!) +- Fixed a crash on Linux caused by an old version of hxCodec (thanks Noobz4Life!) +- Optimized animation handling for characters (thanks richTrash21!) + +## [0.3.3] - 2024-05-14 +### Changed +- Cleaned up some code in `PlayAnimationSongEvent.hx` (thanks BurgerBalls!) +### Fixed +- Fix Web Loading Bar (thanks lemz1!) +- Don't allow any more inputs when exiting freeplay (thanks gamerbros!) +- Fixed using mouse wheel to scroll on freeplay (thanks JugieNoob!) +- Fixed the reset's of the health icons, score, and notes when re-entering gameplay from gameover (thanks ImCodist!) +- Fixed the chart editor character selector's hitbox width (thanks MadBear422!) +- Fixed camera stutter once a wipe transition to the Main Menu completes (thanks ImCodist!) +- Fixed an issue where hold note would be invisible for a single frame (thanks ImCodist!) +- Fix tween accumulation on title screen when pressing Y multiple times (thanks TheGaloXx!) +- Fix for a game over easter egg so you don't accidentally exit it when viewing +- Fix a crash when querying FlxG.state in the crash handler +- Fix an issue where the Freeplay menu never displays 100% clear +- Chart debug key now properly returns you to the previous chart editor session if you were playtesting a chart (thanks nebulazorua!) +- Hopefully fixed Freeplay crashes on AMD gpu's + ## [0.3.2] - 2024-05-03 ### Added - Added `,` and `.` keybinds to the Chart Editor. These place Focus Camera events at the playhead, for the opponent and player respectively.