From 7e52a76329b4030ef7646e3748ea2a9ecaabec4c Mon Sep 17 00:00:00 2001 From: MtH Date: Fri, 19 Mar 2021 18:13:41 +0100 Subject: [PATCH 1/7] 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 db9d4974606182c757010046c844f877d509c5b3 Mon Sep 17 00:00:00 2001 From: MtH Date: Fri, 19 Mar 2021 19:02:42 +0100 Subject: [PATCH 2/7] 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 daef9e07596ca4eac5c7e4c852cad7a67c0f452c Mon Sep 17 00:00:00 2001 From: MtH Date: Sat, 20 Mar 2021 17:33:29 +0100 Subject: [PATCH 3/7] 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 484ad359a49a7b9499a4197ddae557adb8b93db7 Mon Sep 17 00:00:00 2001 From: MtH Date: Sun, 28 Mar 2021 23:29:44 +0200 Subject: [PATCH 4/7] 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 627226dca929917f8c65805c16f9b38f7e1300e1 Mon Sep 17 00:00:00 2001 From: MtH Date: Sun, 28 Mar 2021 23:36:14 +0200 Subject: [PATCH 5/7] 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 03ed9bc2be418282b6e0433d6749fb68e7f3e3ac Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 29 Mar 2021 17:01:49 +0200 Subject: [PATCH 6/7] 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 934e45fa2a334b60d295ecb8dd45844c58033032 Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 29 Mar 2021 17:18:25 +0200 Subject: [PATCH 7/7] 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();