From 2c37d97b1927b244ca864ad49d15de9347134252 Mon Sep 17 00:00:00 2001 From: ItsFellow <59983463+Itsgithubfellow@users.noreply.github.com> Date: Sun, 19 Apr 2026 17:58:48 -0400 Subject: [PATCH 1/4] sorta there --- assets/game/data/characters/bf.json | 136 +++++++++--------- assets/game/data/characters/dad.json | 135 ++++++++--------- source/funkin/states/PlayState.hx | 93 ++++++------ .../states/editors/OLDChartEditorState.hx | 1 + 4 files changed, 190 insertions(+), 175 deletions(-) diff --git a/assets/game/data/characters/bf.json b/assets/game/data/characters/bf.json index cdd6b015..921234f1 100644 --- a/assets/game/data/characters/bf.json +++ b/assets/game/data/characters/bf.json @@ -1,169 +1,169 @@ { "animations": [ { + "loop": false, "offsets": [ -5, 0 ], - "loop": false, - "fps": 24, "anim": "idle", - "indices": [], - "name": "BF idle dance" + "fps": 24, + "name": "BF idle dance", + "indices": [] }, { + "loop": false, "offsets": [ 5, -6 ], - "loop": false, - "fps": 24, "anim": "singLEFT", - "indices": [], - "name": "BF NOTE LEFT0" + "fps": 24, + "name": "BF NOTE LEFT0", + "indices": [] }, { + "loop": false, "offsets": [ -20, -51 ], - "loop": false, - "fps": 24, "anim": "singDOWN", - "indices": [], - "name": "BF NOTE DOWN0" + "fps": 24, + "name": "BF NOTE DOWN0", + "indices": [] }, { + "loop": false, "offsets": [ -46, 27 ], - "loop": false, - "fps": 24, "anim": "singUP", - "indices": [], - "name": "BF NOTE UP0" + "fps": 24, + "name": "BF NOTE UP0", + "indices": [] }, { + "loop": false, "offsets": [ -48, -7 ], - "loop": false, - "fps": 24, "anim": "singRIGHT", - "indices": [], - "name": "BF NOTE RIGHT0" + "fps": 24, + "name": "BF NOTE RIGHT0", + "indices": [] }, { + "loop": false, "offsets": [ 7, 19 ], - "loop": false, - "fps": 24, "anim": "singLEFTmiss", - "indices": [], - "name": "BF NOTE LEFT MISS" + "fps": 24, + "name": "BF NOTE LEFT MISS", + "indices": [] }, { + "loop": false, "offsets": [ -15, -19 ], - "loop": false, - "fps": 24, "anim": "singDOWNmiss", - "indices": [], - "name": "BF NOTE DOWN MISS" + "fps": 24, + "name": "BF NOTE DOWN MISS", + "indices": [] }, { + "loop": false, "offsets": [ -46, 27 ], - "loop": false, - "fps": 24, "anim": "singUPmiss", - "indices": [], - "name": "BF NOTE UP MISS" + "fps": 24, + "name": "BF NOTE UP MISS", + "indices": [] }, { + "loop": false, "offsets": [ -44, 22 ], - "loop": false, - "fps": 24, "anim": "singRIGHTmiss", - "indices": [], - "name": "BF NOTE RIGHT MISS" + "fps": 24, + "name": "BF NOTE RIGHT MISS", + "indices": [] }, { + "loop": false, "offsets": [ -3, 5 ], - "loop": false, - "fps": 24, "anim": "hey", - "indices": [], - "name": "BF HEY!!" + "fps": 24, + "name": "BF HEY!!", + "indices": [] }, { + "loop": false, "offsets": [ 14, 18 ], - "loop": false, - "fps": 24, "anim": "hurt", - "indices": [], - "name": "BF hit" + "fps": 24, + "name": "BF hit", + "indices": [] }, { + "loop": true, "offsets": [ -4, 0 ], - "loop": true, - "fps": 24, "anim": "scared", - "indices": [], - "name": "BF idle shaking" + "fps": 24, + "name": "BF idle shaking", + "indices": [] }, { + "loop": false, "offsets": [ -10, -16 ], - "loop": false, - "fps": 24, "anim": "dodge", - "indices": [], - "name": "boyfriend dodge" + "fps": 24, + "name": "boyfriend dodge", + "indices": [] }, { + "loop": false, "offsets": [ 294, 267 ], - "loop": false, - "fps": 24, "anim": "attack", - "indices": [], - "name": "boyfriend attack" + "fps": 24, + "name": "boyfriend attack", + "indices": [] }, { + "loop": false, "offsets": [ -40, -40 ], - "loop": false, - "fps": 24, "anim": "pre-attack", - "indices": [], - "name": "bf pre attack" + "fps": 24, + "name": "bf pre attack", + "indices": [] } ], "no_antialiasing": false, @@ -172,17 +172,21 @@ 0, 350 ], + "dance_every": 2, + "gameover_intial_sound": null, + "scalableOffsets": false, + "gameover_confirm_sound": null, "healthicon": "bf", + "gameover_character": null, + "vslice_sustains": true, "flip_x": true, - "healthbar_colors": [ - 49, - 176, - 209 - ], + "healthbar_colour": -13520687, "camera_position": [ 0, 0 ], + "gameover_loop_sound": null, "sing_duration": 4, - "scale": 1 + "scale": 1, + "_editor_isPlayer": true } \ No newline at end of file diff --git a/assets/game/data/characters/dad.json b/assets/game/data/characters/dad.json index c2a8c239..f4692094 100644 --- a/assets/game/data/characters/dad.json +++ b/assets/game/data/characters/dad.json @@ -1,145 +1,146 @@ { - "_editor_isPlayer": false, "animations": [ { - "indices": [], + "loop": false, "offsets": [ -9, 10 ], - "fps": 24, "anim": "singLEFT", - "loop": false, - "name": "Dad Sing Note LEFT" + "fps": 24, + "name": "Dad Sing Note LEFT", + "indices": [] }, { - "indices": [], + "loop": false, "offsets": [ 0, -30 ], - "fps": 24, "anim": "singDOWN", - "loop": false, - "name": "Dad Sing Note DOWN" + "fps": 24, + "name": "Dad Sing Note DOWN", + "indices": [] }, { - "indices": [], + "loop": false, "offsets": [ -6, 50 ], - "fps": 24, "anim": "singUP", - "loop": false, - "name": "Dad Sing Note UP" + "fps": 24, + "name": "Dad Sing Note UP", + "indices": [] }, { - "indices": [], + "loop": false, "offsets": [ 0, 27 ], - "fps": 24, "anim": "singRIGHT", - "loop": false, - "name": "Dad Sing Note RIGHT" + "fps": 24, + "name": "Dad Sing Note RIGHT", + "indices": [] }, { - "indices": [], + "loop": false, "offsets": [ 0, 0 ], - "fps": 24, "anim": "idle", - "loop": false, - "name": "Dad idle dance" + "fps": 24, + "name": "Dad idle dance", + "indices": [] }, { + "loop": true, + "offsets": [ + 0, + 0 + ], + "anim": "idle-loop", + "fps": 24, + "name": "Dad idle dance", "indices": [ 10, 11, 12, 12 - ], + ] + }, + { + "loop": true, "offsets": [ - 0, - 0 + -9, + 10 ], + "anim": "singLEFT-loop", "fps": 24, - "anim": "idle-loop", - "loop": true, - "name": "Dad idle dance" - }, - { + "name": "Dad Sing Note LEFT", "indices": [ 12, 13, 14, 15 - ], + ] + }, + { + "loop": true, "offsets": [ - -9, - 10 + 0, + 27 ], + "anim": "singRIGHT-loop", "fps": 24, - "anim": "singLEFT-loop", - "loop": true, - "name": "Dad Sing Note LEFT" - }, - { + "name": "Dad Sing Note RIGHT", "indices": [ 15, 16, 17, 18 - ], + ] + }, + { + "loop": true, "offsets": [ - 0, - 27 + -6, + 50 ], + "anim": "singUP-loop", "fps": 24, - "anim": "singRIGHT-loop", - "loop": true, - "name": "Dad Sing Note RIGHT" - }, - { + "name": "Dad Sing Note UP", "indices": [ 56, 57, 58, 59 - ], - "offsets": [ - -6, - 50 - ], - "fps": 24, - "anim": "singUP-loop", - "loop": true, - "name": "Dad Sing Note UP" + ] } ], - "camera_position": [ - 70, + "no_antialiasing": false, + "image": "characters/DADDY_DEAREST", + "position": [ + 0, 0 ], "dance_every": 2, - "flip_x": false, - "gameover_character": null, - "gameover_confirm_sound": null, "gameover_intial_sound": null, - "gameover_loop_sound": null, - "healthbar_colour": -5282098, + "scalableOffsets": false, + "gameover_confirm_sound": null, "healthicon": "dad", - "image": "characters/DADDY_DEAREST", - "no_antialiasing": false, - "position": [ - 0, + "gameover_character": null, + "vslice_sustains": true, + "flip_x": false, + "healthbar_colour": -5282098, + "camera_position": [ + 70, 0 ], - "scalableOffsets": false, + "gameover_loop_sound": null, + "sing_duration": 6.1, "scale": 1, - "sing_duration": 6.1 + "_editor_isPlayer": false } \ No newline at end of file diff --git a/source/funkin/states/PlayState.hx b/source/funkin/states/PlayState.hx index fa6ee266..21f09141 100644 --- a/source/funkin/states/PlayState.hx +++ b/source/funkin/states/PlayState.hx @@ -179,6 +179,11 @@ class PlayState extends MusicBeatState */ public var isCameraOnForcedPos:Bool = false; + /** + * Disables camera moving on section change + */ + public var ignoreSection:Bool = false; + public var cameraLerping:Bool = true; /** @@ -213,7 +218,7 @@ class PlayState extends MusicBeatState public var gf:Character; /** - Reference to the current girlfriend + Reference to the current boyfriend **/ public var boyfriend:Character; @@ -603,6 +608,7 @@ class PlayState extends MusicBeatState skipCountdown = false; countdownSounds = true; + ignoreSection = false; instance = this; @@ -815,7 +821,7 @@ class PlayState extends MusicBeatState FlxG.watch.addFunction('curStep: ', () -> curStep); #end - moveCameraSection(); + updateCamDisplacement(updateCamTarget()); noteTypeMap?.clear(); noteTypeMap = null; @@ -1568,6 +1574,7 @@ class PlayState extends MusicBeatState Paths.getAtlasFrames(skin.sustainSplashTexture); skin = FlxDestroyUtil.destroy(skin); + case 'Change Character': var charType:Int = 0; switch (event.value1.toLowerCase()) @@ -1723,7 +1730,7 @@ class PlayState extends MusicBeatState FlxG.camera.followLerp = lerpRate; } - if (generatedMusic && !endingSong && !isCameraOnForcedPos) moveCameraSection(); + if (generatedMusic && !endingSong && !isCameraOnForcedPos) updateCamDisplacement(camCurTarget); scripts.call('onUpdate', [elapsed]); @@ -2407,6 +2414,18 @@ class PlayState extends MusicBeatState { Logger.log('Event [Set Property] failed Exception: ${e.toString()}', ERROR); } + case 'Move Camera': + if (value2.toLowerCase() == 'true') ignoreSection = true; + else ignoreSection = false; + switch (value1.toLowerCase()) + { + case 'dad' | 'opponent' | '0': + moveCamera(dad); + case 'gf' | 'girlfriend' | '1': + moveCamera(gf); + default: + moveCamera(boyfriend); + } } scripts.call('onEvent', [eventName, value1, value2]); @@ -2414,36 +2433,6 @@ class PlayState extends MusicBeatState callEventScript(eventName, 'onTrigger', [value1, value2]); } - function moveCameraSection():Void - { - if (SONG.notes[curSection] == null) return; - - if (gf != null && SONG.notes[curSection].gfSection) - { - camFollow.setPosition(gf.getMidpoint().x, gf.getMidpoint().y); - camFollow.x += gf.cameraPosition[0] + girlfriendCameraOffset[0]; - camFollow.y += gf.cameraPosition[1] + girlfriendCameraOffset[1]; - - if (ClientPrefs.camFollowsCharacters) - { - final displacement = gf.getSingDisplacement(); - - camFollow.x += displacement.x; - camFollow.y += displacement.y; - - displacement.putWeak(); - } - - scripts.call('onMoveCamera', ['gf']); - scripts.set('whosTurn', 'gf'); - return; - } - - var isDad = !SONG.notes[curSection].mustHitSection; - moveCamera(isDad); - scripts.call('onMoveCamera', [isDad ? 'dad' : 'boyfriend']); - } - public function getCharacterCameraPos(char:Null):FlxPoint { if (char == null) return FlxPoint.weak(); @@ -2468,24 +2457,41 @@ class PlayState extends MusicBeatState return desiredPos; } - public function moveCamera(isDad:Bool):Void + function updateCamTarget():Character + { + var isDad = !SONG.notes[curSection].mustHitSection; + var char = isDad ? dad : boyfriend; + return char; + } + + public function moveCamera(char:Character):Void { var desiredPos:Null = null; var curCharacter:Null = null; - if (opponentStrums != null && playerStrums != null) curCharacter = isDad ? opponentStrums.owner : playerStrums.owner; - else curCharacter = isDad ? dad : boyfriend; - - if (camCurTarget != null) curCharacter = camCurTarget; + if (char != null) + { + curCharacter = char; + camCurTarget = curCharacter; + } - desiredPos = getCharacterCameraPos(curCharacter); + scripts.call('onMoveCamera', [char]); + scripts.set('whosTurn', char); + // updateCamDisplacement(char); + } + + function updateCamDisplacement(char:Character) + { + if (char == null) return; + var desiredPos:Null = null; + desiredPos = getCharacterCameraPos(char); camFollow.x = desiredPos.x; camFollow.y = desiredPos.y; if (ClientPrefs.camFollowsCharacters) { - final displacement = curCharacter.getSingDisplacement(); + final displacement = char.getSingDisplacement(); camFollow.x += displacement.x; camFollow.y += displacement.y; @@ -2494,8 +2500,6 @@ class PlayState extends MusicBeatState } desiredPos.put(); - - scripts.set('whosTurn', isDad ? 'dad' : 'boyfriend'); } /** @@ -2932,6 +2936,11 @@ class PlayState extends MusicBeatState { if (SONG.notes[curSection] != null) { + if (!ignoreSection) + { + moveCamera(updateCamTarget()); + } + if (SONG.notes[curSection].changeBPM) { Conductor.bpm = SONG.notes[curSection].bpm; diff --git a/source/funkin/states/editors/OLDChartEditorState.hx b/source/funkin/states/editors/OLDChartEditorState.hx index 05f65123..71eed0c1 100644 --- a/source/funkin/states/editors/OLDChartEditorState.hx +++ b/source/funkin/states/editors/OLDChartEditorState.hx @@ -127,6 +127,7 @@ class OLDChartEditorState extends MusicBeatState ['Change Scroll Speed', "Value 1: Scroll Speed Multiplier (1 is default)\nValue 2: Time it takes to change fully in seconds."], ['Set Property', "Value 1: Variable name\nValue 2: New value"], ['HUD Fade', "Fades the HUD camera\n\nValue 1: Alpha\nValue 2: Duration"], + ['Move Camera', "Moves the camera to the specified character\n\nValue 1: Character (BF default)\nValue 2: Ignore section"], ['Camera Fade', "Fades the game camera\n\nValue 1: Alpha\nValue 2: Duration"], ['Camera Flash', "Value 1: Color, Alpha (Optional)\nValue 2: Fade duration"], ['Camera Zoom', "Changes the Camera Zoom.\n\nValue 1: Zoom Multiplier (1 is default)\n\nIn case you want a tween, use Value 2 like this:\n\n\"3, elasticOut\"\n(Duration, Ease Type)"], From 507bb1289a69df727ee6e8bcf3fa971f562f4afb Mon Sep 17 00:00:00 2001 From: ItsFellow <59983463+Itsgithubfellow@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:34:16 -0400 Subject: [PATCH 2/4] Update PlayState.hx --- source/funkin/states/PlayState.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/funkin/states/PlayState.hx b/source/funkin/states/PlayState.hx index 21f09141..6d960f8e 100644 --- a/source/funkin/states/PlayState.hx +++ b/source/funkin/states/PlayState.hx @@ -2417,13 +2417,18 @@ class PlayState extends MusicBeatState case 'Move Camera': if (value2.toLowerCase() == 'true') ignoreSection = true; else ignoreSection = false; + switch (value1.toLowerCase()) { case 'dad' | 'opponent' | '0': moveCamera(dad); case 'gf' | 'girlfriend' | '1': moveCamera(gf); + case 'bf' | 'boyfriend' | '2': + moveCamera(boyfriend); default: + // gonna add support for other chars too + // idk how atm moveCamera(boyfriend); } } From ee220f70def98c5334bbfaf7cf7919b450195765 Mon Sep 17 00:00:00 2001 From: ItsFellow <59983463+Itsgithubfellow@users.noreply.github.com> Date: Sun, 19 Apr 2026 22:11:28 -0400 Subject: [PATCH 3/4] added support for other chars --- source/funkin/states/PlayState.hx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/funkin/states/PlayState.hx b/source/funkin/states/PlayState.hx index 6d960f8e..e328ac24 100644 --- a/source/funkin/states/PlayState.hx +++ b/source/funkin/states/PlayState.hx @@ -2418,7 +2418,11 @@ class PlayState extends MusicBeatState if (value2.toLowerCase() == 'true') ignoreSection = true; else ignoreSection = false; - switch (value1.toLowerCase()) + var charToFocus:Character = null; + var charName = value1.toLowerCase(); + + // some quick shortcuts + switch (charName) { case 'dad' | 'opponent' | '0': moveCamera(dad); @@ -2427,9 +2431,12 @@ class PlayState extends MusicBeatState case 'bf' | 'boyfriend' | '2': moveCamera(boyfriend); default: - // gonna add support for other chars too - // idk how atm - moveCamera(boyfriend); + // not too proud of this + charToFocus = dadGroup.map.get(charName); + if (charToFocus == null) charToFocus = boyfriendGroup.map.get(charName); + if (charToFocus == null) charToFocus = gfGroup.map.get(charName); + charToFocus = dadGroup.addToList(charName); + moveCamera(charToFocus); } } From 0c33a3cf8fceffdbd2794d775d329a4f06f32a3f Mon Sep 17 00:00:00 2001 From: ItsFellow <59983463+Itsgithubfellow@users.noreply.github.com> Date: Mon, 20 Apr 2026 20:28:16 -0400 Subject: [PATCH 4/4] dad & bf vslice_sustains = false --- assets/game/data/characters/bf.json | 2 +- assets/game/data/characters/dad.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/game/data/characters/bf.json b/assets/game/data/characters/bf.json index 921234f1..c5ba04c5 100644 --- a/assets/game/data/characters/bf.json +++ b/assets/game/data/characters/bf.json @@ -178,7 +178,7 @@ "gameover_confirm_sound": null, "healthicon": "bf", "gameover_character": null, - "vslice_sustains": true, + "vslice_sustains": false, "flip_x": true, "healthbar_colour": -13520687, "camera_position": [ diff --git a/assets/game/data/characters/dad.json b/assets/game/data/characters/dad.json index f4692094..f44df710 100644 --- a/assets/game/data/characters/dad.json +++ b/assets/game/data/characters/dad.json @@ -132,7 +132,7 @@ "gameover_confirm_sound": null, "healthicon": "dad", "gameover_character": null, - "vslice_sustains": true, + "vslice_sustains": false, "flip_x": false, "healthbar_colour": -5282098, "camera_position": [