From 77128f523e3f12a95cafa0e32695f07f981eb293 Mon Sep 17 00:00:00 2001 From: MtH Date: Fri, 19 Mar 2021 18:13:41 +0100 Subject: [PATCH 1/8] quickAnimAdd() for all, fixes looping anims dad, pico looping idle fixed, they now dance on beat instead also adds animation.finish() after initial anims, so their anims on create don't get in the way of anims during countdown commented-out idea for senpai idle, as it's currently 2 beats long but not properly on beat --- source/BackgroundDancer.hx | 1 + source/BackgroundGirls.hx | 2 + source/Character.hx | 309 +++++++++++++++++-------------------- source/PlayState.hx | 3 +- 4 files changed, 146 insertions(+), 169 deletions(-) diff --git a/source/BackgroundDancer.hx b/source/BackgroundDancer.hx index a619dacc2..43a68c145 100644 --- a/source/BackgroundDancer.hx +++ b/source/BackgroundDancer.hx @@ -13,6 +13,7 @@ class BackgroundDancer extends FlxSprite animation.addByIndices('danceLeft', 'bg dancer sketch PINK', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false); animation.addByIndices('danceRight', 'bg dancer sketch PINK', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false); animation.play('danceLeft'); + animation.finish(); antialiasing = true; } diff --git a/source/BackgroundGirls.hx b/source/BackgroundGirls.hx index c37b16f91..1a6030362 100644 --- a/source/BackgroundGirls.hx +++ b/source/BackgroundGirls.hx @@ -16,6 +16,7 @@ class BackgroundGirls extends FlxSprite animation.addByIndices('danceRight', 'BG girls group', CoolUtil.numberArray(30, 15), "", 24, false); animation.play('danceLeft'); + animation.finish(); } var danceDir:Bool = false; @@ -25,6 +26,7 @@ class BackgroundGirls extends FlxSprite animation.addByIndices('danceLeft', 'BG fangirls dissuaded', CoolUtil.numberArray(14), "", 24, false); animation.addByIndices('danceRight', 'BG fangirls dissuaded', CoolUtil.numberArray(30, 15), "", 24, false); dance(); + animation.finish(); } public function dance():Void diff --git a/source/Character.hx b/source/Character.hx index ef8c3d96b..1547b2c4a 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -35,17 +35,17 @@ class Character extends FlxSprite // GIRLFRIEND CODE tex = Paths.getSparrowAtlas('characters/GF_assets'); frames = tex; - animation.addByPrefix('cheer', 'GF Cheer', 24, false); - animation.addByPrefix('singLEFT', 'GF left note', 24, false); - animation.addByPrefix('singRIGHT', 'GF Right Note', 24, false); - animation.addByPrefix('singUP', 'GF Up Note', 24, false); - animation.addByPrefix('singDOWN', 'GF Down Note', 24, false); + quickAnimAdd('cheer', 'GF Cheer'); + quickAnimAdd('singLEFT', 'GF left note'); + quickAnimAdd('singRIGHT', 'GF Right Note'); + quickAnimAdd('singUP', 'GF Up Note'); + quickAnimAdd('singDOWN', 'GF Down Note'); animation.addByIndices('sad', 'gf sad', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "", 24, false); animation.addByIndices('danceLeft', 'GF Dancing Beat', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false); animation.addByIndices('danceRight', 'GF Dancing Beat', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false); animation.addByIndices('hairBlow', "GF Dancing Beat Hair blowing", [0, 1, 2, 3], "", 24); animation.addByIndices('hairFall', "GF Dancing Beat Hair Landing", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], "", 24, false); - animation.addByPrefix('scared', 'GF FEAR', 24); + animation.addByPrefix('scared', 'GF FEAR', 24, true); loadOffsetFile(curCharacter); @@ -54,17 +54,17 @@ class Character extends FlxSprite case 'gf-christmas': tex = Paths.getSparrowAtlas('christmas/gfChristmas'); frames = tex; - animation.addByPrefix('cheer', 'GF Cheer', 24, false); - animation.addByPrefix('singLEFT', 'GF left note', 24, false); - animation.addByPrefix('singRIGHT', 'GF Right Note', 24, false); - animation.addByPrefix('singUP', 'GF Up Note', 24, false); - animation.addByPrefix('singDOWN', 'GF Down Note', 24, false); + quickAnimAdd('cheer', 'GF Cheer'); + quickAnimAdd('singLEFT', 'GF left note'); + quickAnimAdd('singRIGHT', 'GF Right Note'); + quickAnimAdd('singUP', 'GF Up Note'); + quickAnimAdd('singDOWN', 'GF Down Note'); animation.addByIndices('sad', 'gf sad', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "", 24, false); animation.addByIndices('danceLeft', 'GF Dancing Beat', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false); animation.addByIndices('danceRight', 'GF Dancing Beat', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false); animation.addByIndices('hairBlow', "GF Dancing Beat Hair blowing", [0, 1, 2, 3], "", 24); animation.addByIndices('hairFall', "GF Dancing Beat Hair Landing", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], "", 24, false); - animation.addByPrefix('scared', 'GF FEAR', 24); + animation.addByPrefix('scared', 'GF FEAR', 24, true); addOffset('cheer'); addOffset('sad', -2, -21); @@ -135,11 +135,11 @@ class Character extends FlxSprite // DAD ANIMATION LOADING CODE tex = Paths.getSparrowAtlas('DADDY_DEAREST'); frames = tex; - animation.addByPrefix('idle', 'Dad idle dance', 24); - animation.addByPrefix('singUP', 'Dad Sing Note UP', 24); - animation.addByPrefix('singRIGHT', 'Dad Sing Note RIGHT', 24); - animation.addByPrefix('singDOWN', 'Dad Sing Note DOWN', 24); - animation.addByPrefix('singLEFT', 'Dad Sing Note LEFT', 24); + quickAnimAdd('idle', 'Dad idle dance'); + quickAnimAdd('singUP', 'Dad Sing Note UP'); + quickAnimAdd('singRIGHT', 'Dad Sing Note RIGHT'); + quickAnimAdd('singDOWN', 'Dad Sing Note DOWN'); + quickAnimAdd('singLEFT', 'Dad Sing Note LEFT'); addOffset('idle'); addOffset("singUP", -6, 50); @@ -151,10 +151,10 @@ class Character extends FlxSprite case 'spooky': tex = Paths.getSparrowAtlas('spooky_kids_assets'); frames = tex; - animation.addByPrefix('singUP', 'spooky UP NOTE', 24, false); - animation.addByPrefix('singDOWN', 'spooky DOWN note', 24, false); - animation.addByPrefix('singLEFT', 'note sing left', 24, false); - animation.addByPrefix('singRIGHT', 'spooky sing right', 24, false); + quickAnimAdd('singUP', 'spooky UP NOTE'); + quickAnimAdd('singDOWN', 'spooky DOWN note'); + quickAnimAdd('singLEFT', 'note sing left'); + quickAnimAdd('singRIGHT', 'spooky sing right'); animation.addByIndices('danceLeft', 'spooky dance idle', [0, 2, 6], "", 12, false); animation.addByIndices('danceRight', 'spooky dance idle', [8, 10, 12, 14], "", 12, false); @@ -171,13 +171,13 @@ class Character extends FlxSprite tex = Paths.getSparrowAtlas('Mom_Assets'); frames = tex; - animation.addByPrefix('idle', "Mom Idle", 24, false); - animation.addByPrefix('singUP', "Mom Up Pose", 24, false); - animation.addByPrefix('singDOWN', "MOM DOWN POSE", 24, false); - animation.addByPrefix('singLEFT', 'Mom Left Pose', 24, false); + quickAnimAdd('idle', "Mom Idle"); + quickAnimAdd('singUP', "Mom Up Pose"); + quickAnimAdd('singDOWN', "MOM DOWN POSE"); + quickAnimAdd('singLEFT', 'Mom Left Pose'); // ANIMATION IS CALLED MOM LEFT POSE BUT ITS FOR THE RIGHT // CUZ DAVE IS DUMB! - animation.addByPrefix('singRIGHT', 'Mom Pose Left', 24, false); + quickAnimAdd('singRIGHT', 'Mom Pose Left'); addOffset('idle'); addOffset("singUP", 14, 71); @@ -191,13 +191,13 @@ class Character extends FlxSprite tex = Paths.getSparrowAtlas('momCar'); frames = tex; - animation.addByPrefix('idle', "Mom Idle", 24, false); - animation.addByPrefix('singUP', "Mom Up Pose", 24, false); - animation.addByPrefix('singDOWN', "MOM DOWN POSE", 24, false); - animation.addByPrefix('singLEFT', 'Mom Left Pose', 24, false); + quickAnimAdd('idle', "Mom Idle"); + quickAnimAdd('singUP', "Mom Up Pose"); + quickAnimAdd('singDOWN', "MOM DOWN POSE"); + quickAnimAdd('singLEFT', 'Mom Left Pose'); // ANIMATION IS CALLED MOM LEFT POSE BUT ITS FOR THE RIGHT // CUZ DAVE IS DUMB! - animation.addByPrefix('singRIGHT', 'Mom Pose Left', 24, false); + quickAnimAdd('singRIGHT', 'Mom Pose Left'); addOffset('idle'); addOffset("singUP", 14, 71); @@ -209,11 +209,11 @@ class Character extends FlxSprite case 'monster': tex = Paths.getSparrowAtlas('Monster_Assets'); frames = tex; - animation.addByPrefix('idle', 'monster idle', 24, false); - animation.addByPrefix('singUP', 'monster up note', 24, false); - animation.addByPrefix('singDOWN', 'monster down', 24, false); - animation.addByPrefix('singLEFT', 'Monster left note', 24, false); - animation.addByPrefix('singRIGHT', 'Monster Right note', 24, false); + quickAnimAdd('idle', 'monster idle'); + quickAnimAdd('singUP', 'monster up note'); + quickAnimAdd('singDOWN', 'monster down'); + quickAnimAdd('singLEFT', 'Monster left note'); + quickAnimAdd('singRIGHT', 'Monster Right note'); addOffset('idle'); addOffset("singUP", -20, 94); @@ -224,11 +224,11 @@ class Character extends FlxSprite case 'monster-christmas': tex = Paths.getSparrowAtlas('christmas/monsterChristmas'); frames = tex; - animation.addByPrefix('idle', 'monster idle', 24, false); - animation.addByPrefix('singUP', 'monster up note', 24, false); - animation.addByPrefix('singDOWN', 'monster down', 24, false); - animation.addByPrefix('singLEFT', 'Monster left note', 24, false); - animation.addByPrefix('singRIGHT', 'Monster Right note', 24, false); + quickAnimAdd('idle', 'monster idle'); + quickAnimAdd('singUP', 'monster up note'); + quickAnimAdd('singDOWN', 'monster down'); + quickAnimAdd('singLEFT', 'Monster left note'); + quickAnimAdd('singRIGHT', 'Monster Right note'); addOffset('idle'); addOffset("singUP", -20, 50); @@ -239,27 +239,27 @@ class Character extends FlxSprite case 'pico': tex = Paths.getSparrowAtlas('Pico_FNF_assetss'); frames = tex; - animation.addByPrefix('idle', "Pico Idle Dance", 24); - animation.addByPrefix('singUP', 'pico Up note0', 24, false); - animation.addByPrefix('singDOWN', 'Pico Down Note0', 24, false); + quickAnimAdd('idle', "Pico Idle Dance"); + quickAnimAdd('singUP', 'pico Up note0'); + quickAnimAdd('singDOWN', 'Pico Down Note0'); if (isPlayer) { - animation.addByPrefix('singLEFT', 'Pico NOTE LEFT0', 24, false); - animation.addByPrefix('singRIGHT', 'Pico Note Right0', 24, false); - animation.addByPrefix('singRIGHTmiss', 'Pico Note Right Miss', 24, false); - animation.addByPrefix('singLEFTmiss', 'Pico NOTE LEFT miss', 24, false); + quickAnimAdd('singLEFT', 'Pico NOTE LEFT0'); + quickAnimAdd('singRIGHT', 'Pico Note Right0'); + quickAnimAdd('singRIGHTmiss', 'Pico Note Right Miss'); + quickAnimAdd('singLEFTmiss', 'Pico NOTE LEFT miss'); } else { // Need to be flipped! REDO THIS LATER! - animation.addByPrefix('singLEFT', 'Pico Note Right0', 24, false); - animation.addByPrefix('singRIGHT', 'Pico NOTE LEFT0', 24, false); - animation.addByPrefix('singRIGHTmiss', 'Pico NOTE LEFT miss', 24, false); - animation.addByPrefix('singLEFTmiss', 'Pico Note Right Miss', 24, false); + quickAnimAdd('singLEFT', 'Pico Note Right0'); + quickAnimAdd('singRIGHT', 'Pico NOTE LEFT0'); + quickAnimAdd('singRIGHTmiss', 'Pico NOTE LEFT miss'); + quickAnimAdd('singLEFTmiss', 'Pico Note Right Miss'); } - animation.addByPrefix('singUPmiss', 'pico Up note miss', 24); - animation.addByPrefix('singDOWNmiss', 'Pico Down Note MISS', 24); + quickAnimAdd('singUPmiss', 'pico Up note miss'); + quickAnimAdd('singDOWNmiss', 'Pico Down Note MISS'); addOffset('idle'); addOffset("singUP", -29, 27); @@ -290,22 +290,22 @@ class Character extends FlxSprite case 'bf': var tex = Paths.getSparrowAtlas('characters/BOYFRIEND'); frames = tex; - animation.addByPrefix('idle', 'BF idle dance', 24, false); - animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false); - animation.addByPrefix('singLEFT', 'BF NOTE LEFT0', 24, false); - animation.addByPrefix('singRIGHT', 'BF NOTE RIGHT0', 24, false); - animation.addByPrefix('singDOWN', 'BF NOTE DOWN0', 24, false); - animation.addByPrefix('singUPmiss', 'BF NOTE UP MISS', 24, false); - animation.addByPrefix('singLEFTmiss', 'BF NOTE LEFT MISS', 24, false); - animation.addByPrefix('singRIGHTmiss', 'BF NOTE RIGHT MISS', 24, false); - animation.addByPrefix('singDOWNmiss', 'BF NOTE DOWN MISS', 24, false); - animation.addByPrefix('hey', 'BF HEY', 24, false); + quickAnimAdd('idle', 'BF idle dance'); + quickAnimAdd('singUP', 'BF NOTE UP0'); + quickAnimAdd('singLEFT', 'BF NOTE LEFT0'); + quickAnimAdd('singRIGHT', 'BF NOTE RIGHT0'); + quickAnimAdd('singDOWN', 'BF NOTE DOWN0'); + quickAnimAdd('singUPmiss', 'BF NOTE UP MISS'); + quickAnimAdd('singLEFTmiss', 'BF NOTE LEFT MISS'); + quickAnimAdd('singRIGHTmiss', 'BF NOTE RIGHT MISS'); + quickAnimAdd('singDOWNmiss', 'BF NOTE DOWN MISS'); + quickAnimAdd('hey', 'BF HEY'); - animation.addByPrefix('firstDeath', "BF dies", 24, false); + quickAnimAdd('firstDeath', "BF dies"); animation.addByPrefix('deathLoop', "BF Dead Loop", 24, true); - animation.addByPrefix('deathConfirm', "BF Dead confirm", 24, false); + quickAnimAdd('deathConfirm', "BF Dead confirm"); - animation.addByPrefix('scared', 'BF idle shaking', 24); + animation.addByPrefix('scared', 'BF idle shaking', 24, true); loadOffsetFile(curCharacter); @@ -318,16 +318,16 @@ class Character extends FlxSprite case 'bf-christmas': var tex = Paths.getSparrowAtlas('christmas/bfChristmas'); frames = tex; - animation.addByPrefix('idle', 'BF idle dance', 24, false); - animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false); - animation.addByPrefix('singLEFT', 'BF NOTE LEFT0', 24, false); - animation.addByPrefix('singRIGHT', 'BF NOTE RIGHT0', 24, false); - animation.addByPrefix('singDOWN', 'BF NOTE DOWN0', 24, false); - animation.addByPrefix('singUPmiss', 'BF NOTE UP MISS', 24, false); - animation.addByPrefix('singLEFTmiss', 'BF NOTE LEFT MISS', 24, false); - animation.addByPrefix('singRIGHTmiss', 'BF NOTE RIGHT MISS', 24, false); - animation.addByPrefix('singDOWNmiss', 'BF NOTE DOWN MISS', 24, false); - animation.addByPrefix('hey', 'BF HEY', 24, false); + quickAnimAdd('idle', 'BF idle dance'); + quickAnimAdd('singUP', 'BF NOTE UP0'); + quickAnimAdd('singLEFT', 'BF NOTE LEFT0'); + quickAnimAdd('singRIGHT', 'BF NOTE RIGHT0'); + quickAnimAdd('singDOWN', 'BF NOTE DOWN0'); + quickAnimAdd('singUPmiss', 'BF NOTE UP MISS'); + quickAnimAdd('singLEFTmiss', 'BF NOTE LEFT MISS'); + quickAnimAdd('singRIGHTmiss', 'BF NOTE RIGHT MISS'); + quickAnimAdd('singDOWNmiss', 'BF NOTE DOWN MISS'); + quickAnimAdd('hey', 'BF HEY'); addOffset('idle', -5); addOffset("singUP", -29, 27); @@ -346,15 +346,15 @@ class Character extends FlxSprite case 'bf-car': var tex = Paths.getSparrowAtlas('bfCar'); frames = tex; - animation.addByPrefix('idle', 'BF idle dance', 24, false); - animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false); - animation.addByPrefix('singLEFT', 'BF NOTE LEFT0', 24, false); - animation.addByPrefix('singRIGHT', 'BF NOTE RIGHT0', 24, false); - animation.addByPrefix('singDOWN', 'BF NOTE DOWN0', 24, false); - animation.addByPrefix('singUPmiss', 'BF NOTE UP MISS', 24, false); - animation.addByPrefix('singLEFTmiss', 'BF NOTE LEFT MISS', 24, false); - animation.addByPrefix('singRIGHTmiss', 'BF NOTE RIGHT MISS', 24, false); - animation.addByPrefix('singDOWNmiss', 'BF NOTE DOWN MISS', 24, false); + quickAnimAdd('idle', 'BF idle dance'); + quickAnimAdd('singUP', 'BF NOTE UP0'); + quickAnimAdd('singLEFT', 'BF NOTE LEFT0'); + quickAnimAdd('singRIGHT', 'BF NOTE RIGHT0'); + quickAnimAdd('singDOWN', 'BF NOTE DOWN0'); + quickAnimAdd('singUPmiss', 'BF NOTE UP MISS'); + quickAnimAdd('singLEFTmiss', 'BF NOTE LEFT MISS'); + quickAnimAdd('singRIGHTmiss', 'BF NOTE RIGHT MISS'); + quickAnimAdd('singDOWNmiss', 'BF NOTE DOWN MISS'); addOffset('idle', -5); addOffset("singUP", -29, 27); @@ -370,15 +370,15 @@ class Character extends FlxSprite flipX = true; case 'bf-pixel': frames = Paths.getSparrowAtlas('weeb/bfPixel'); - animation.addByPrefix('idle', 'BF IDLE', 24, false); - animation.addByPrefix('singUP', 'BF UP NOTE', 24, false); - animation.addByPrefix('singLEFT', 'BF LEFT NOTE', 24, false); - animation.addByPrefix('singRIGHT', 'BF RIGHT NOTE', 24, false); - animation.addByPrefix('singDOWN', 'BF DOWN NOTE', 24, false); - animation.addByPrefix('singUPmiss', 'BF UP MISS', 24, false); - animation.addByPrefix('singLEFTmiss', 'BF LEFT MISS', 24, false); - animation.addByPrefix('singRIGHTmiss', 'BF RIGHT MISS', 24, false); - animation.addByPrefix('singDOWNmiss', 'BF DOWN MISS', 24, false); + quickAnimAdd('idle', 'BF IDLE'); + quickAnimAdd('singUP', 'BF UP NOTE'); + quickAnimAdd('singLEFT', 'BF LEFT NOTE'); + quickAnimAdd('singRIGHT', 'BF RIGHT NOTE'); + quickAnimAdd('singDOWN', 'BF DOWN NOTE'); + quickAnimAdd('singUPmiss', 'BF UP MISS'); + quickAnimAdd('singLEFTmiss', 'BF LEFT MISS'); + quickAnimAdd('singRIGHTmiss', 'BF RIGHT MISS'); + quickAnimAdd('singDOWNmiss', 'BF DOWN MISS'); addOffset('idle'); addOffset("singUP"); @@ -403,10 +403,10 @@ class Character extends FlxSprite flipX = true; case 'bf-pixel-dead': frames = Paths.getSparrowAtlas('weeb/bfPixelsDEAD'); - animation.addByPrefix('singUP', "BF Dies pixel", 24, false); - animation.addByPrefix('firstDeath', "BF Dies pixel", 24, false); + quickAnimAdd('singUP', "BF Dies pixel"); + quickAnimAdd('firstDeath', "BF Dies pixel"); animation.addByPrefix('deathLoop', "Retry Loop", 24, true); - animation.addByPrefix('deathConfirm', "RETRY CONFIRM", 24, false); + quickAnimAdd('deathConfirm', "RETRY CONFIRM"); animation.play('firstDeath'); addOffset('firstDeath'); @@ -421,11 +421,16 @@ class Character extends FlxSprite case 'senpai': frames = Paths.getSparrowAtlas('weeb/senpai'); - animation.addByPrefix('idle', 'Senpai Idle', 24, false); - animation.addByPrefix('singUP', 'SENPAI UP NOTE', 24, false); - animation.addByPrefix('singLEFT', 'SENPAI LEFT NOTE', 24, false); - animation.addByPrefix('singRIGHT', 'SENPAI RIGHT NOTE', 24, false); - animation.addByPrefix('singDOWN', 'SENPAI DOWN NOTE', 24, false); + quickAnimAdd('idle', 'Senpai Idle'); + // at framerate 16.8 animation plays over 2 beats at 144bpm, + // but if the game lags or the bpm is > 144 (mods etc.) + // he may miss his next dance + // animation.getByName('idle').frameRate = 16.8; + + quickAnimAdd('singUP', 'SENPAI UP NOTE'); + quickAnimAdd('singLEFT', 'SENPAI LEFT NOTE'); + quickAnimAdd('singRIGHT', 'SENPAI RIGHT NOTE'); + quickAnimAdd('singDOWN', 'SENPAI DOWN NOTE'); addOffset('idle'); addOffset("singUP", 5, 37); @@ -441,11 +446,11 @@ class Character extends FlxSprite antialiasing = false; case 'senpai-angry': frames = Paths.getSparrowAtlas('weeb/senpai'); - animation.addByPrefix('idle', 'Angry Senpai Idle', 24, false); - animation.addByPrefix('singUP', 'Angry Senpai UP NOTE', 24, false); - animation.addByPrefix('singLEFT', 'Angry Senpai LEFT NOTE', 24, false); - animation.addByPrefix('singRIGHT', 'Angry Senpai RIGHT NOTE', 24, false); - animation.addByPrefix('singDOWN', 'Angry Senpai DOWN NOTE', 24, false); + quickAnimAdd('idle', 'Angry Senpai Idle'); + quickAnimAdd('singUP', 'Angry Senpai UP NOTE'); + quickAnimAdd('singLEFT', 'Angry Senpai LEFT NOTE'); + quickAnimAdd('singRIGHT', 'Angry Senpai RIGHT NOTE'); + quickAnimAdd('singDOWN', 'Angry Senpai DOWN NOTE'); addOffset('idle'); addOffset("singUP", 5, 37); @@ -461,11 +466,11 @@ class Character extends FlxSprite case 'spirit': frames = Paths.getPackerAtlas('weeb/spirit'); - animation.addByPrefix('idle', "idle spirit_", 24, false); - animation.addByPrefix('singUP', "up_", 24, false); - animation.addByPrefix('singRIGHT', "right_", 24, false); - animation.addByPrefix('singLEFT', "left_", 24, false); - animation.addByPrefix('singDOWN', "spirit down_", 24, false); + quickAnimAdd('idle', "idle spirit_"); + quickAnimAdd('singUP', "up_"); + quickAnimAdd('singRIGHT', "right_"); + quickAnimAdd('singLEFT', "left_"); + quickAnimAdd('singDOWN', "spirit down_"); addOffset('idle', -220, -280); addOffset('singUP', -220, -240); @@ -482,17 +487,17 @@ class Character extends FlxSprite case 'parents-christmas': frames = Paths.getSparrowAtlas('christmas/mom_dad_christmas_assets'); - animation.addByPrefix('idle', 'Parent Christmas Idle', 24, false); - animation.addByPrefix('singUP', 'Parent Up Note Dad', 24, false); - animation.addByPrefix('singDOWN', 'Parent Down Note Dad', 24, false); - animation.addByPrefix('singLEFT', 'Parent Left Note Dad', 24, false); - animation.addByPrefix('singRIGHT', 'Parent Right Note Dad', 24, false); + quickAnimAdd('idle', 'Parent Christmas Idle'); + quickAnimAdd('singUP', 'Parent Up Note Dad'); + quickAnimAdd('singDOWN', 'Parent Down Note Dad'); + quickAnimAdd('singLEFT', 'Parent Left Note Dad'); + quickAnimAdd('singRIGHT', 'Parent Right Note Dad'); - animation.addByPrefix('singUP-alt', 'Parent Up Note Mom', 24, false); + quickAnimAdd('singUP-alt', 'Parent Up Note Mom'); - animation.addByPrefix('singDOWN-alt', 'Parent Down Note Mom', 24, false); - animation.addByPrefix('singLEFT-alt', 'Parent Left Note Mom', 24, false); - animation.addByPrefix('singRIGHT-alt', 'Parent Right Note Mom', 24, false); + quickAnimAdd('singDOWN-alt', 'Parent Down Note Mom'); + quickAnimAdd('singLEFT-alt', 'Parent Left Note Mom'); + quickAnimAdd('singRIGHT-alt', 'Parent Right Note Mom'); addOffset('idle'); addOffset("singUP", -47, 24); @@ -508,28 +513,28 @@ class Character extends FlxSprite case 'tankman': frames = Paths.getSparrowAtlas('characters/tankmanCaptain'); - animation.addByPrefix('idle', "Tankman Idle Dance", 24, false); + quickAnimAdd('idle', "Tankman Idle Dance"); if (isPlayer) { - animation.addByPrefix('singLEFT', 'Tankman Note Left0', 24, false); - animation.addByPrefix('singRIGHT', 'Tankman Right Note0', 24, false); - animation.addByPrefix('singLEFTmiss', 'Tankman Note Left MISS', 24, false); - animation.addByPrefix('singRIGHTmiss', 'Tankman Right Note MISS', 24, false); + quickAnimAdd('singLEFT', 'Tankman Note Left0'); + quickAnimAdd('singRIGHT', 'Tankman Right Note0'); + quickAnimAdd('singLEFTmiss', 'Tankman Note Left MISS'); + quickAnimAdd('singRIGHTmiss', 'Tankman Right Note MISS'); } else { // Need to be flipped! REDO THIS LATER - animation.addByPrefix('singLEFT', 'Tankman Right Note0', 24, false); - animation.addByPrefix('singRIGHT', 'Tankman Note Left0', 24, false); - animation.addByPrefix('singLEFTmiss', 'Tankman Right Note MISS', 24, false); - animation.addByPrefix('singRIGHTmiss', 'Tankman Note Left MISS', 24, false); + quickAnimAdd('singLEFT', 'Tankman Right Note0'); + quickAnimAdd('singRIGHT', 'Tankman Note Left0'); + quickAnimAdd('singLEFTmiss', 'Tankman Right Note MISS'); + quickAnimAdd('singRIGHTmiss', 'Tankman Note Left MISS'); } - animation.addByPrefix('singUP', 'Tankman UP note0', 24, false); - animation.addByPrefix('singDOWN', 'Tankman DOWN note0', 24, false); - animation.addByPrefix('singUPmiss', 'Tankman UP note MISS', 24, false); - animation.addByPrefix('singDOWNmiss', 'Tankman DOWN note MISS', 24, false); + quickAnimAdd('singUP', 'Tankman UP note0'); + quickAnimAdd('singDOWN', 'Tankman DOWN note0'); + quickAnimAdd('singUPmiss', 'Tankman UP note MISS'); + quickAnimAdd('singDOWNmiss', 'Tankman DOWN note MISS'); loadOffsetFile(curCharacter); @@ -539,6 +544,7 @@ class Character extends FlxSprite } dance(); + animation.finish(); if (isPlayer) { @@ -620,7 +626,7 @@ class Character extends FlxSprite { switch (curCharacter) { - case 'gf': + case 'gf' | 'gf-christmas' | 'gf-car' | 'gf-pixel': if (!animation.curAnim.name.startsWith('hair')) { danced = !danced; @@ -631,37 +637,6 @@ class Character extends FlxSprite playAnim('danceLeft'); } - case 'gf-christmas': - if (!animation.curAnim.name.startsWith('hair')) - { - danced = !danced; - - if (danced) - playAnim('danceRight'); - else - playAnim('danceLeft'); - } - - case 'gf-car': - if (!animation.curAnim.name.startsWith('hair')) - { - danced = !danced; - - if (danced) - playAnim('danceRight'); - else - playAnim('danceLeft'); - } - case 'gf-pixel': - if (!animation.curAnim.name.startsWith('hair')) - { - danced = !danced; - - if (danced) - playAnim('danceRight'); - else - playAnim('danceLeft'); - } case 'pico-speaker': playAnim('shoot' + FlxG.random.int(1, 4), true); diff --git a/source/PlayState.hx b/source/PlayState.hx index 971b1f651..9548ad1e0 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1048,12 +1048,11 @@ class PlayState extends MusicBeatState } }); FlxG.sound.play(Paths.sound('introGo'), 0.6); - case 4: } swagCounter += 1; // generateSong('fresh'); - }, 5); + }, 4); } var previousFrameTime:Int = 0; From ed324cd9c61da37b447538f453622a42f78aa014 Mon Sep 17 00:00:00 2001 From: MtH Date: Fri, 19 Mar 2021 19:02:42 +0100 Subject: [PATCH 2/8] hair blowing idle loop for week4 --- source/Character.hx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/Character.hx b/source/Character.hx index 1547b2c4a..e48f2b84e 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -109,9 +109,11 @@ class Character extends FlxSprite animation.addByIndices('danceLeft', 'GF Dancing Beat Hair blowing CAR', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false); animation.addByIndices('danceRight', 'GF Dancing Beat Hair blowing CAR', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false); + animation.addByIndices('idleHair', 'GF Dancing Beat Hair blowing CAR', [10, 11, 12, 25, 26, 27], "", 24, true); addOffset('danceLeft', 0); addOffset('danceRight', 0); + addOffset('idleHair', 0); playAnim('danceRight'); @@ -198,12 +200,14 @@ class Character extends FlxSprite // ANIMATION IS CALLED MOM LEFT POSE BUT ITS FOR THE RIGHT // CUZ DAVE IS DUMB! quickAnimAdd('singRIGHT', 'Mom Pose Left'); + animation.addByIndices('idleHair', "Mom Idle", [10, 11, 12, 13], "", 24, true); addOffset('idle'); addOffset("singUP", 14, 71); addOffset("singRIGHT", 10, -60); addOffset("singLEFT", 250, -23); addOffset("singDOWN", 20, -160); + addOffset('idleHair'); playAnim('idle'); case 'monster': @@ -355,6 +359,7 @@ class Character extends FlxSprite quickAnimAdd('singLEFTmiss', 'BF NOTE LEFT MISS'); quickAnimAdd('singRIGHTmiss', 'BF NOTE RIGHT MISS'); quickAnimAdd('singDOWNmiss', 'BF NOTE DOWN MISS'); + animation.addByIndices('idleHair', 'BF idle dance', [10, 11, 12, 13], "", 24, true); addOffset('idle', -5); addOffset("singUP", -29, 27); @@ -365,6 +370,7 @@ class Character extends FlxSprite addOffset("singRIGHTmiss", -30, 21); addOffset("singLEFTmiss", 12, 24); addOffset("singDOWNmiss", -11, -19); + addOffset('idleHair', -5); playAnim('idle'); flipX = true; @@ -605,6 +611,13 @@ class Character extends FlxSprite } } + if (curCharacter.endsWith('-car')) + { + // looping hair anims after idle finished + if (!animation.curAnim.name.startsWith('sing') && animation.curAnim.finished) + playAnim('idleHair'); + } + switch (curCharacter) { case 'gf': From 2c295911ccd865433a42415726f0b213a724c520 Mon Sep 17 00:00:00 2001 From: MtH Date: Sat, 20 Mar 2021 17:33:29 +0100 Subject: [PATCH 3/8] DECIMAL BPM support for da charters out there, also changes to HealthIcon to better work in ChartingState --- source/ChartingState.hx | 30 ++++++++++++++++-------------- source/Conductor.hx | 8 ++++---- source/HealthIcon.hx | 38 +++++++++++++++++--------------------- source/Section.hx | 2 +- source/Song.hx | 4 ++-- 5 files changed, 40 insertions(+), 42 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 64a0de8fb..1b6fedbf4 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -76,7 +76,7 @@ class ChartingState extends MusicBeatState **/ var curSelectedNote:Array; - var tempBpm:Int = 0; + var tempBpm:Float = 0; var vocals:FlxSound; @@ -171,6 +171,7 @@ class ChartingState extends MusicBeatState add(curRenderedNotes); add(curRenderedSustains); + changeSection(); super.create(); } @@ -217,11 +218,11 @@ class ChartingState extends MusicBeatState var loadAutosaveBtn:FlxButton = new FlxButton(reloadSongJson.x, reloadSongJson.y + 30, 'load autosave', loadAutosave); - var stepperSpeed:FlxUINumericStepper = new FlxUINumericStepper(10, 80, 0.1, 1, 0.1, 10, 1); + var stepperSpeed:FlxUINumericStepper = new FlxUINumericStepper(10, 80, 0.1, 1, 0.1, 10, 2); stepperSpeed.value = _song.speed; stepperSpeed.name = 'song_speed'; - var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 1, 1, 339, 0); + var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 100, 1, 999, 3); stepperBPM.value = Conductor.bpm; stepperBPM.name = 'song_bpm'; @@ -230,14 +231,15 @@ class ChartingState extends MusicBeatState var player1DropDown = new FlxUIDropDownMenu(10, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String) { _song.player1 = characters[Std.parseInt(character)]; + updateHeads(); }); player1DropDown.selectedLabel = _song.player1; var player2DropDown = new FlxUIDropDownMenu(140, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String) { _song.player2 = characters[Std.parseInt(character)]; + updateHeads(); }); - player2DropDown.selectedLabel = _song.player2; var tab_group_song = new FlxUI(null, UI_box); @@ -276,7 +278,7 @@ class ChartingState extends MusicBeatState stepperLength.value = _song.notes[curSection].lengthInSteps; stepperLength.name = "section_length"; - stepperSectionBPM = new FlxUINumericStepper(10, 80, 1, Conductor.bpm, 0, 999, 0); + stepperSectionBPM = new FlxUINumericStepper(10, 80, 1, Conductor.bpm, 1, 999, 3); stepperSectionBPM.value = Conductor.bpm; stepperSectionBPM.name = 'section_bpm'; @@ -425,9 +427,9 @@ class ChartingState extends MusicBeatState } else if (wname == 'song_bpm') { - tempBpm = Std.int(nums.value); + tempBpm = nums.value; Conductor.mapBPMChanges(_song); - Conductor.changeBPM(Std.int(nums.value)); + Conductor.changeBPM(nums.value); } else if (wname == 'note_susLength') { @@ -436,7 +438,7 @@ class ChartingState extends MusicBeatState } else if (wname == 'section_bpm') { - _song.notes[curSection].bpm = Std.int(nums.value); + _song.notes[curSection].bpm = nums.value; updateGrid(); } } @@ -456,7 +458,7 @@ class ChartingState extends MusicBeatState }*/ function sectionStartTime():Float { - var daBPM:Int = _song.bpm; + var daBPM:Float = _song.bpm; var daPos:Float = 0; for (i in 0...curSection) { @@ -793,13 +795,13 @@ class ChartingState extends MusicBeatState { if (check_mustHitSection.checked) { - leftIcon.animation.play('bf'); - rightIcon.animation.play('dad'); + leftIcon.changeIcon(_song.player1); + rightIcon.changeIcon(_song.player2); } else { - leftIcon.animation.play('dad'); - rightIcon.animation.play('bf'); + leftIcon.changeIcon(_song.player2); + rightIcon.changeIcon(_song.player1); } } @@ -831,7 +833,7 @@ class ChartingState extends MusicBeatState else { // get last bpm - var daBPM:Int = _song.bpm; + var daBPM:Float = _song.bpm; for (i in 0...curSection) if (_song.notes[i].changeBPM) daBPM = _song.notes[i].bpm; diff --git a/source/Conductor.hx b/source/Conductor.hx index a182070b0..9f3f50031 100644 --- a/source/Conductor.hx +++ b/source/Conductor.hx @@ -11,12 +11,12 @@ typedef BPMChangeEvent = { var stepTime:Int; var songTime:Float; - var bpm:Int; + var bpm:Float; } class Conductor { - public static var bpm:Int = 100; + public static var bpm:Float = 100; public static var crochet:Float = ((60 / bpm) * 1000); // beats in milliseconds public static var stepCrochet:Float = crochet / 4; // steps in milliseconds public static var songPosition:Float; @@ -36,7 +36,7 @@ class Conductor { bpmChangeMap = []; - var curBPM:Int = song.bpm; + var curBPM:Float = song.bpm; var totalSteps:Int = 0; var totalPos:Float = 0; for (i in 0...song.notes.length) @@ -59,7 +59,7 @@ class Conductor trace("new BPM map BUDDY " + bpmChangeMap); } - public static function changeBPM(newBpm:Int) + public static function changeBPM(newBpm:Float) { bpm = newBpm; diff --git a/source/HealthIcon.hx b/source/HealthIcon.hx index 46adbcec3..883d3525c 100644 --- a/source/HealthIcon.hx +++ b/source/HealthIcon.hx @@ -11,7 +11,7 @@ class HealthIcon extends FlxSprite */ public var sprTracker:FlxSprite; - var char:String = 'bf'; + var char:String = ''; var isPlayer:Bool = false; public function new(char:String = 'bf', isPlayer:Bool = false) @@ -19,9 +19,8 @@ class HealthIcon extends FlxSprite super(); this.isPlayer = isPlayer; - this.char = char; - loadIcon(char); + changeIcon(char); antialiasing = true; scrollFactor.set(); } @@ -33,29 +32,26 @@ class HealthIcon extends FlxSprite isOldIcon = !isOldIcon; if (isOldIcon) - { - loadGraphic(Paths.image('icons/icon-bf-old'), true, 150, 150); - animation.add('bf-old', [0, 1], 0, false, isPlayer); - animation.play('bf-old'); - } + changeIcon('bf-old'); else - loadIcon(char); + changeIcon('bf'); } - function loadIcon(char:String):Void + public function changeIcon(newChar:String):Void { - var realChar:String = ""; - switch (char) - { - case 'bf-pixel': - realChar = char; - default: - realChar = char.split('-')[0].trim(); - } + if (newChar != 'bf-pixel' && newChar != 'bf-old') + newChar = newChar.split('-')[0].trim(); - loadGraphic(Paths.image('icons/icon-' + realChar), true, 150, 150); - animation.add(realChar, [0, 1], 0, false, isPlayer); - animation.play(realChar); + if (newChar != char) + { + if (animation.getByName(newChar) == null) + { + loadGraphic(Paths.image('icons/icon-' + newChar), true, 150, 150); + animation.add(newChar, [0, 1], 0, false, isPlayer); + } + animation.play(newChar); + char = newChar; + } } override function update(elapsed:Float) diff --git a/source/Section.hx b/source/Section.hx index c859f6f31..f153da54f 100644 --- a/source/Section.hx +++ b/source/Section.hx @@ -6,7 +6,7 @@ typedef SwagSection = var lengthInSteps:Int; var typeOfSection:Int; var mustHitSection:Bool; - var bpm:Int; + var bpm:Float; var changeBPM:Bool; var altAnim:Bool; } diff --git a/source/Song.hx b/source/Song.hx index 407abb2db..2ea2a2f81 100644 --- a/source/Song.hx +++ b/source/Song.hx @@ -11,7 +11,7 @@ typedef SwagSong = { var song:String; var notes:Array; - var bpm:Int; + var bpm:Float; var needsVoices:Bool; var speed:Float; @@ -24,7 +24,7 @@ class Song { public var song:String; public var notes:Array; - public var bpm:Int; + public var bpm:Float; public var needsVoices:Bool = true; public var speed:Float = 1; From 03ecdf7b5e1268188025dd755c090de5ec22a17d Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 22 Mar 2021 02:40:21 +0100 Subject: [PATCH 4/8] spookeez .ogg desync fix with no quality loss --- assets/songs/spookeez/Inst.ogg | Bin 1611036 -> 1610616 bytes assets/songs/spookeez/Voices.ogg | Bin 1332725 -> 1332723 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/songs/spookeez/Inst.ogg b/assets/songs/spookeez/Inst.ogg index e14fd8b5cc27986f64124a51dbee216d7b4405af..86bb13064576aa479a40d36adda9043bd6d57463 100644 GIT binary patch delta 3717 zcmYL~dq7lG9>On%Wxg;)&;CxQ;rh=9_<+kHRjrVdEX|l*~ z&vA;DXi#oe{5F*Fp_^eD4KnuTD+9BowoM8gQ%S6(2JST|YNFw{bBc|&jL1V?TYord*ns$t_nC9};DTux#$LDe&%g?mfv;Dt{!d;Ph5#3i32#t z#Y};%dS$*XBLvY8&N7b3=RRNZ!79mHuPo)sXyQp;fIE)LrpYiaTF&%dkuy%1xjyRZ zsnt?zl(Iri7L(T#U~`-@Dj4QhE8}cqdK>6ju`$lbv-v01R!X<3lq=N4Omd^){aWRZ z(_r*bWxwqNECza1EaHNE@XCSHE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ku9K9|^8QF!W6@tj!#N3`mJdK0X@raL%PYxlqCljs>f#Jo=wjSAhg~ZO$-4Sk z0Qlz`j}ZkU4Qh|(LC9g_Tn9EP1S$B^ikEQyy779-D->yH?RS0P!IiEJVWZ|E9X*t` z4K9R9BSKjUL(={hk^+KV(z8^;aHOD!o=tG|igXj5)Ci;}jL#^U9*7b5Tz(JYFrcpaw-F-4IvzfT&)krgp?2xzztr0otdsMJ{X-^N>=bM&3dd zBR@=g{1nMD<(?&YM#=Li`&c9!ySraO{T_J|(R`$i7ppTtbW=V~NyH)5c+AQJg;?QB z6pysVy;}$=QHl^MP6ATSgT`*C*`XMv4lO`x$%!|E+N+8We|w2YPsb{(z>TA<3}aJG zLh8t9jDefs%2wJ?GSWBcj(xDdL>WrkPC?RYlXk&VP=0vyQjtzt`q;srFO)X4$Aw5U z&UZS3m9>eS4rUrs|Mar^;GJsHJeR%WBBYoVXIH`GVUy)_Owy6^m6uhpw%=qqWxp6H zb?>8O7*aF;(*M#DB(e3@E_j*Bv{R}XNJ|ESUPGIX*+rGeL|Qs^U?(iN&D^4@W+9bo z#%sZWQ3V93^p9RP5`V+u9_Pt|Ny|yWHhf{)!LfK%1dq+}GaNSM8U^4hEK_x*N`Lg| gg|`&1`*ThY;y{L)SKIt?BnL-&-?WrVbS{kge?B?EFaQ7m From 8ae8aaec5116373eb8b61e1bf11e85c8052c6029 Mon Sep 17 00:00:00 2001 From: MtH Date: Sun, 28 Mar 2021 23:29:44 +0200 Subject: [PATCH 5/8] FIX NOTE HITS fixes weird note misses when multiple notes are hittable also fixes notes on HUD appearing pressed when the button is released during game pause/window unfocus --- source/PlayState.hx | 234 +++++++++++++------------------------------- 1 file changed, 70 insertions(+), 164 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index e3241f34d..6526b97b4 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2014,157 +2014,92 @@ class PlayState extends MusicBeatState private function keyShit():Void { - // HOLDING - var up = controls.NOTE_UP; - var right = controls.NOTE_RIGHT; - var down = controls.NOTE_DOWN; - var left = controls.NOTE_LEFT; + // control arrays, order L D R U + var holdArray:Array = [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT]; + var pressArray:Array = [controls.NOTE_LEFT_P, controls.NOTE_DOWN_P, controls.NOTE_UP_P, controls.NOTE_RIGHT_P]; + var releaseArray:Array = [controls.NOTE_LEFT_R, controls.NOTE_DOWN_R, controls.NOTE_UP_R, controls.NOTE_RIGHT_R]; - var upP = controls.NOTE_UP_P; - var rightP = controls.NOTE_RIGHT_P; - var downP = controls.NOTE_DOWN_P; - var leftP = controls.NOTE_LEFT_P; - - var upR = controls.NOTE_UP_R; - var rightR = controls.NOTE_RIGHT_R; - var downR = controls.NOTE_DOWN_R; - var leftR = controls.NOTE_LEFT_R; - - var controlArray:Array = [leftP, downP, upP, rightP]; - - // FlxG.watch.addQuick('asdfa', upP); - if ((upP || rightP || downP || leftP) && generatedMusic) + // HOLDS, check for sustain notes + if (holdArray.contains(true) && /*!boyfriend.stunned && */ generatedMusic) { - // note to self, used to have stunned - // && !boyfriend.stunned + notes.forEachAlive(function(daNote:Note) + { + if (daNote.isSustainNote && daNote.canBeHit && daNote.mustPress && holdArray[daNote.noteData]) + goodNoteHit(daNote); + }); + } + // PRESSES, check for note hits + if (pressArray.contains(true) && /*!boyfriend.stunned && */ generatedMusic) + { boyfriend.holdTimer = 0; - var possibleNotes:Array = []; - - var ignoreList:Array = []; + var possibleNotes:Array = []; // notes that can be hit + var directionList:Array = []; // directions that can be hit + var dumbNotes:Array = []; // notes to kill later notes.forEachAlive(function(daNote:Note) { if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit) { - // the sorting probably doesn't need to be in here? who cares lol - possibleNotes.push(daNote); - possibleNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime)); - - ignoreList.push(daNote.noteData); - } - }); - - if (possibleNotes.length > 0) - { - var daNote = possibleNotes[0]; - - if (perfectMode) - noteCheck(true, daNote); - - // Jump notes - if (possibleNotes.length >= 2) - { - if (possibleNotes[0].strumTime == possibleNotes[1].strumTime) + if (directionList.contains(daNote.noteData)) { for (coolNote in possibleNotes) { - if (controlArray[coolNote.noteData]) - goodNoteHit(coolNote); - else - { - var inIgnoreList:Bool = false; - for (shit in 0...ignoreList.length) - { - if (controlArray[ignoreList[shit]]) - inIgnoreList = true; - } - if (!inIgnoreList) - badNoteCheck(); + if (coolNote.noteData == daNote.noteData && Math.abs(daNote.strumTime - coolNote.strumTime) < 10) + { // if it's the same note twice at < 10ms distance, just delete it + // EXCEPT u cant delete it in this loop cuz it fucks with the collection lol + dumbNotes.push(daNote); + break; + } + else if (coolNote.noteData == daNote.noteData && daNote.strumTime < coolNote.strumTime) + { // if daNote is earlier than existing note (coolNote), replace + possibleNotes.remove(coolNote); + possibleNotes.push(daNote); + break; } } } - else if (possibleNotes[0].noteData == possibleNotes[1].noteData) - { - noteCheck(controlArray[daNote.noteData], daNote); - } else { - for (coolNote in possibleNotes) - { - noteCheck(controlArray[coolNote.noteData], coolNote); - } - } - } - else // regular notes? - { - noteCheck(controlArray[daNote.noteData], daNote); - } - /* - if (controlArray[daNote.noteData]) - goodNoteHit(daNote); - */ - // trace(daNote.noteData); - /* - switch (daNote.noteData) - { - case 2: // NOTES YOU JUST PRESSED - if (upP || rightP || downP || leftP) - noteCheck(upP, daNote); - case 3: - if (upP || rightP || downP || leftP) - noteCheck(rightP, daNote); - case 1: - if (upP || rightP || downP || leftP) - noteCheck(downP, daNote); - case 0: - if (upP || rightP || downP || leftP) - noteCheck(leftP, daNote); - } - - //this is already done in noteCheck / goodNoteHit - if (daNote.wasGoodHit) - { - daNote.kill(); - notes.remove(daNote, true); - daNote.destroy(); - } - */ - } - else - { - badNoteCheck(); - } - } - - if ((up || right || down || left) && /*!boyfriend.stunned && */ generatedMusic) - { - notes.forEachAlive(function(daNote:Note) - { - if (daNote.canBeHit && daNote.mustPress && daNote.isSustainNote) - { - switch (daNote.noteData) - { - // NOTES YOU ARE HOLDING - case 0: - if (left) - goodNoteHit(daNote); - case 1: - if (down) - goodNoteHit(daNote); - case 2: - if (up) - goodNoteHit(daNote); - case 3: - if (right) - goodNoteHit(daNote); + possibleNotes.push(daNote); + directionList.push(daNote.noteData); } } }); + + for (note in dumbNotes) + { + FlxG.log.add("killing dumb ass note at "+note.strumTime); + note.kill(); + notes.remove(note, true); + note.destroy(); + } + + possibleNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime)); + + if (perfectMode) + goodNoteHit(possibleNotes[0]); + else if (possibleNotes.length > 0) + { + for (shit in 0...pressArray.length) + { // if a direction is hit that shouldn't be + if (pressArray[shit] && !directionList.contains(shit)) + badNoteHit(); + } + for (coolNote in possibleNotes) + { + if (pressArray[coolNote.noteData]) + goodNoteHit(coolNote); + } + } + else + { + badNoteHit(); + } } - if (boyfriend.holdTimer > Conductor.stepCrochet * 4 * 0.001 && !up && !down && !right && !left) + if (boyfriend.holdTimer > Conductor.stepCrochet * 4 * 0.001 && !holdArray.contains(true)) { if (boyfriend.animation.curAnim.name.startsWith('sing') && !boyfriend.animation.curAnim.name.endsWith('miss')) { @@ -2174,29 +2109,10 @@ class PlayState extends MusicBeatState playerStrums.forEach(function(spr:FlxSprite) { - switch (spr.ID) - { - case 0: - if (leftP && spr.animation.curAnim.name != 'confirm') - spr.animation.play('pressed'); - if (leftR) - spr.animation.play('static'); - case 1: - if (downP && spr.animation.curAnim.name != 'confirm') - spr.animation.play('pressed'); - if (downR) - spr.animation.play('static'); - case 2: - if (upP && spr.animation.curAnim.name != 'confirm') - spr.animation.play('pressed'); - if (upR) - spr.animation.play('static'); - case 3: - if (rightP && spr.animation.curAnim.name != 'confirm') - spr.animation.play('pressed'); - if (rightR) - spr.animation.play('static'); - } + if (pressArray[spr.ID] && spr.animation.curAnim.name != 'confirm') + spr.animation.play('pressed'); + if (!holdArray[spr.ID]) + spr.animation.play('static'); if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) { @@ -2248,14 +2164,14 @@ class PlayState extends MusicBeatState } } - function badNoteCheck() + function badNoteHit() { // just double pasting this shit cuz fuk u // REDO THIS SYSTEM! + var leftP = controls.NOTE_LEFT_P; + var downP = controls.NOTE_DOWN_P; var upP = controls.NOTE_UP_P; var rightP = controls.NOTE_RIGHT_P; - var downP = controls.NOTE_DOWN_P; - var leftP = controls.NOTE_LEFT_P; if (leftP) noteMiss(0); @@ -2267,16 +2183,6 @@ class PlayState extends MusicBeatState noteMiss(3); } - function noteCheck(keyP:Bool, note:Note):Void - { - if (keyP) - goodNoteHit(note); - else - { - badNoteCheck(); - } - } - function goodNoteHit(note:Note):Void { if (!note.wasGoodHit) From 6ccf1940cd64d37dc875c998a638f4d5aed70419 Mon Sep 17 00:00:00 2001 From: MtH Date: Sun, 28 Mar 2021 23:36:14 +0200 Subject: [PATCH 6/8] pixel countdown --- source/PlayState.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 6526b97b4..a31998508 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -994,7 +994,7 @@ class PlayState extends MusicBeatState { case 0: - FlxG.sound.play(Paths.sound('intro3'), 0.6); + FlxG.sound.play(Paths.sound('intro3' + altSuffix), 0.6); case 1: var ready:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[0])); ready.scrollFactor.set(); @@ -1012,7 +1012,7 @@ class PlayState extends MusicBeatState ready.destroy(); } }); - FlxG.sound.play(Paths.sound('intro2'), 0.6); + FlxG.sound.play(Paths.sound('intro2' + altSuffix), 0.6); case 2: var set:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[1])); set.scrollFactor.set(); @@ -1029,7 +1029,7 @@ class PlayState extends MusicBeatState set.destroy(); } }); - FlxG.sound.play(Paths.sound('intro1'), 0.6); + FlxG.sound.play(Paths.sound('intro1' + altSuffix), 0.6); case 3: var go:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[2])); go.scrollFactor.set(); @@ -1048,7 +1048,7 @@ class PlayState extends MusicBeatState go.destroy(); } }); - FlxG.sound.play(Paths.sound('introGo'), 0.6); + FlxG.sound.play(Paths.sound('introGo' + altSuffix), 0.6); } swagCounter += 1; From f067ebd8e9e76a5183fec361021e9eb633dab991 Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 29 Mar 2021 17:01:49 +0200 Subject: [PATCH 7/8] resync by BOTH voices and inst also remove unnecessary includes in chartingstate --- source/ChartingState.hx | 2 -- source/PlayState.hx | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 1b6fedbf4..49ab32380 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -28,8 +28,6 @@ import haxe.Json; import lime.utils.Assets; import openfl.events.Event; import openfl.events.IOErrorEvent; -import openfl.events.IOErrorEvent; -import openfl.events.IOErrorEvent; import openfl.media.Sound; import openfl.net.FileReference; import openfl.utils.ByteArray; diff --git a/source/PlayState.hx b/source/PlayState.hx index a31998508..1b6063625 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2320,7 +2320,7 @@ class PlayState extends MusicBeatState override function stepHit() { super.stepHit(); - if (FlxG.sound.music.time > Conductor.songPosition + 20 || FlxG.sound.music.time < Conductor.songPosition - 20) + if (Math.abs(FlxG.sound.music.time - Conductor.songPosition) > 20 || (SONG.needsVoices && Math.abs(vocals.time - Conductor.songPosition) > 20)) { resyncVocals(); } From cfa0128db7417cce0cb315f2b899269e109ca17a Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 29 Mar 2021 17:18:25 +0200 Subject: [PATCH 8/8] week score lerp fix INSPIRED BY PR #447 BY @jvc https://github.com/ninjamuffin99/Funkin/pull/447 --- source/StoryMenuState.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index 3c9d629ec..23bbee0bb 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -227,6 +227,9 @@ class StoryMenuState extends MusicBeatState // scoreText.setFormat('VCR OSD Mono', 32); lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.5)); + if (Math.abs(lerpScore - intendedScore) <= 10) + lerpScore = intendedScore; + scoreText.text = "WEEK SCORE:" + lerpScore; txtWeekTitle.text = weekNames[curWeek].toUpperCase();