From 9f1b18d8dc82342feda52270a79e4963de5aa9c4 Mon Sep 17 00:00:00 2001 From: MtH Date: Tue, 30 Mar 2021 05:45:04 +0200 Subject: [PATCH 1/7] test song and added to freeplay (JUST FOR TESTING) --- source/FreeplayState.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 2297439e3..96dbd8827 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -83,6 +83,8 @@ class FreeplayState extends MusicBeatState if (StoryMenuState.weekUnlocked[7] || isDebug) addWeek(['Ugh', 'Guns', 'Stress'], 7, ['tankman']); + addWeek(['Test'], 6, ['bf-pixel']); + // LOAD MUSIC // LOAD CHARACTERS From 427ce7bd7f8d6e91c6928e0f30a6b86f2b2f82b0 Mon Sep 17 00:00:00 2001 From: MtH Date: Sat, 3 Apr 2021 01:42:11 +0200 Subject: [PATCH 2/7] remove test from freeplay --- source/FreeplayState.hx | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 96dbd8827..2297439e3 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -83,8 +83,6 @@ class FreeplayState extends MusicBeatState if (StoryMenuState.weekUnlocked[7] || isDebug) addWeek(['Ugh', 'Guns', 'Stress'], 7, ['tankman']); - addWeek(['Test'], 6, ['bf-pixel']); - // LOAD MUSIC // LOAD CHARACTERS From 84be474f150c35dc114e0f68ed1784bc416c7c57 Mon Sep 17 00:00:00 2001 From: MtH Date: Wed, 14 Apr 2021 04:02:21 +0200 Subject: [PATCH 3/7] framerate adjusted lerps for all menu shit that isnt cameras --- source/Alphabet.hx | 4 ++-- source/CoolUtil.hx | 9 +++++++++ source/FreeplayState.hx | 11 ++++------- source/MenuItem.hx | 2 +- source/StoryMenuState.hx | 9 +++------ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/source/Alphabet.hx b/source/Alphabet.hx index 6fca9d0a5..b4a28e5db 100644 --- a/source/Alphabet.hx +++ b/source/Alphabet.hx @@ -224,8 +224,8 @@ class Alphabet extends FlxSpriteGroup { var scaledY = FlxMath.remapToRange(targetY, 0, 1, 0, 1.3); - y = FlxMath.lerp(y, (scaledY * 120) + (FlxG.height * 0.48), 0.16); - x = FlxMath.lerp(x, (targetY * 20) + 90, 0.16); + y = CoolUtil.coolLerp(y, (scaledY * 120) + (FlxG.height * 0.48), 0.16); + x = CoolUtil.coolLerp(x, (targetY * 20) + 90, 0.16); } super.update(elapsed); diff --git a/source/CoolUtil.hx b/source/CoolUtil.hx index 2e93961c1..58c719847 100644 --- a/source/CoolUtil.hx +++ b/source/CoolUtil.hx @@ -3,6 +3,7 @@ package; import flixel.FlxG; import flixel.graphics.FlxGraphic; import flixel.graphics.frames.FlxAtlasFrames; +import flixel.math.FlxMath; import flixel.math.FlxPoint; import flixel.math.FlxRect; import flixel.system.FlxAssets.FlxGraphicAsset; @@ -55,6 +56,14 @@ class CoolUtil return lerp * (FlxG.elapsed / (1 / 60)); } + /* + * just lerp that does camLerpShit for u so u dont have to do it every time + */ + public static function coolLerp(a:Float, b:Float, ratio:Float):Float + { + return FlxMath.lerp(a, b, camLerpShit(ratio)); + } + public static function fromAnimate(Source:FlxGraphicAsset, Description:String):FlxAtlasFrames { var graphic:FlxGraphic = FlxG.bitmap.add(Source); diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index f43334ffc..fccfcc440 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -26,7 +26,7 @@ class FreeplayState extends MusicBeatState var scoreText:FlxText; var diffText:FlxText; - var lerpScore:Int = 0; + var lerpScore:Float = 0; var intendedScore:Int = 0; var coolColors:Array = [ @@ -204,13 +204,10 @@ class FreeplayState extends MusicBeatState } } - lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4)); - bg.color = FlxColor.interpolate(bg.color, coolColors[songs[curSelected].week % coolColors.length], 0.045); + lerpScore = CoolUtil.coolLerp(lerpScore, intendedScore, 0.4); + bg.color = FlxColor.interpolate(bg.color, coolColors[songs[curSelected].week % coolColors.length], CoolUtil.camLerpShit(0.045)); - if (Math.abs(lerpScore - intendedScore) <= 10) - lerpScore = intendedScore; - - scoreText.text = "PERSONAL BEST:" + lerpScore; + scoreText.text = "PERSONAL BEST:" + Math.round(lerpScore); positionHighscore(); diff --git a/source/MenuItem.hx b/source/MenuItem.hx index f41d893c7..e60e62280 100644 --- a/source/MenuItem.hx +++ b/source/MenuItem.hx @@ -36,7 +36,7 @@ class MenuItem extends FlxSpriteGroup override function update(elapsed:Float) { super.update(elapsed); - y = FlxMath.lerp(y, (targetY * 120) + 480, 0.17); + y = CoolUtil.coolLerp(y, (targetY * 120) + 480, 0.17); if (isFlashing) flashingInt += 1; diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index 55ea89e3f..8cc6d59c3 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -228,12 +228,9 @@ class StoryMenuState extends MusicBeatState override function update(elapsed:Float) { // scoreText.setFormat('VCR OSD Mono', 32); - lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.5)); + lerpScore = CoolUtil.coolLerp(lerpScore, intendedScore, 0.5); - if (Math.abs(lerpScore - intendedScore) <= 10) - lerpScore = intendedScore; - - scoreText.text = "WEEK SCORE:" + lerpScore; + scoreText.text = "WEEK SCORE:" + Math.round(lerpScore); txtWeekTitle.text = weekNames[curWeek].toUpperCase(); txtWeekTitle.x = FlxG.width - (txtWeekTitle.width + 10); @@ -369,7 +366,7 @@ class StoryMenuState extends MusicBeatState FlxTween.tween(sprDifficulty, {y: leftArrow.y + 15, alpha: 1}, 0.07); } - var lerpScore:Int = 0; + var lerpScore:Float = 0; var intendedScore:Int = 0; function changeWeek(change:Int = 0):Void From 5cc9f5532b94817e45c41a08bf21966c016b4c2d Mon Sep 17 00:00:00 2001 From: MtH Date: Thu, 15 Apr 2021 02:18:59 +0200 Subject: [PATCH 4/7] eggnog > winter-horrorland transiton FIX --- source/PlayState.hx | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index d09d83dd1..01f8e0d0a 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2296,6 +2296,12 @@ class PlayState extends MusicBeatState trace('LOADING NEXT SONG'); trace(storyPlaylist[0].toLowerCase() + difficulty); + FlxTransitionableState.skipNextTransIn = true; + FlxTransitionableState.skipNextTransOut = true; + + FlxG.sound.music.stop(); + vocals.stop(); + if (SONG.song.toLowerCase() == 'eggnog') { var blackShit:FlxSprite = new FlxSprite(-FlxG.width * FlxG.camera.zoom, @@ -2303,18 +2309,21 @@ class PlayState extends MusicBeatState blackShit.scrollFactor.set(); add(blackShit); camHUD.visible = false; + inCutscene = true; - FlxG.sound.play(Paths.sound('Lights_Shut_off')); + FlxG.sound.play(Paths.sound('Lights_Shut_off'), function(){ + // no camFollow so it centers on horror tree + SONG = Song.loadFromJson(storyPlaylist[0].toLowerCase() + difficulty, storyPlaylist[0]); + LoadingState.loadAndSwitchState(new PlayState()); + }); } + else + { + prevCamFollow = camFollow; - FlxTransitionableState.skipNextTransIn = true; - FlxTransitionableState.skipNextTransOut = true; - prevCamFollow = camFollow; - - SONG = Song.loadFromJson(storyPlaylist[0].toLowerCase() + difficulty, storyPlaylist[0]); - FlxG.sound.music.stop(); - - LoadingState.loadAndSwitchState(new PlayState()); + SONG = Song.loadFromJson(storyPlaylist[0].toLowerCase() + difficulty, storyPlaylist[0]); + LoadingState.loadAndSwitchState(new PlayState()); + } } } else @@ -2325,8 +2334,6 @@ class PlayState extends MusicBeatState } } - var endingSong:Bool = false; - private function popUpScore(strumtime:Float, daNote:Note):Void { var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition); From 86e1aed2fab624cb40479f11bcb59bd736b281fe Mon Sep 17 00:00:00 2001 From: MtH Date: Thu, 15 Apr 2021 03:56:42 +0200 Subject: [PATCH 5/7] week6 cam center and move senpaiEvil --- source/PlayState.hx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 01f8e0d0a..8403128a3 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -989,7 +989,6 @@ class PlayState extends MusicBeatState cameraMovement(); startCountdown(); - camHUD.visible = true; }); }); }); @@ -1039,8 +1038,6 @@ class PlayState extends MusicBeatState dad.visible = true; gfCutsceneLayer.remove(tankCutscene); }); - - camHUD.visible = true; }); } @@ -1333,10 +1330,13 @@ class PlayState extends MusicBeatState var senpaiEvil:FlxSprite = new FlxSprite(); senpaiEvil.frames = Paths.getSparrowAtlas('weeb/senpaiCrazy'); senpaiEvil.animation.addByPrefix('idle', 'Senpai Pre Explosion', 24, false); - senpaiEvil.setGraphicSize(Std.int(senpaiEvil.width * 6)); + senpaiEvil.setGraphicSize(Std.int(senpaiEvil.width * daPixelZoom)); senpaiEvil.scrollFactor.set(); senpaiEvil.updateHitbox(); senpaiEvil.screenCenter(); + senpaiEvil.x += senpaiEvil.width / 5; + + camFollow.setPosition(camPos.x, camPos.y); if (SONG.song.toLowerCase() == 'roses' || SONG.song.toLowerCase() == 'thorns') { @@ -1345,6 +1345,7 @@ class PlayState extends MusicBeatState if (SONG.song.toLowerCase() == 'thorns') { add(red); + camHUD.visible = false; } } @@ -1383,6 +1384,7 @@ class PlayState extends MusicBeatState FlxG.camera.fade(FlxColor.WHITE, 0.01, true, function() { add(dialogueBox); + camHUD.visible = true; }, true); }); new FlxTimer().start(3.2, function(deadTime:FlxTimer) @@ -1411,6 +1413,7 @@ class PlayState extends MusicBeatState function startCountdown():Void { inCutscene = false; + camHUD.visible = true; generateStaticArrows(0); generateStaticArrows(1); @@ -2516,10 +2519,7 @@ class PlayState extends MusicBeatState { case 'mom': camFollow.y = dad.getMidpoint().y; - case 'senpai': - camFollow.y = dad.getMidpoint().y - 430; - camFollow.x = dad.getMidpoint().x - 100; - case 'senpai-angry': + case 'senpai' | 'senpai-angry': camFollow.y = dad.getMidpoint().y - 430; camFollow.x = dad.getMidpoint().x - 100; } From 76dbe40e11eccc36996bae22e2f78613910466d8 Mon Sep 17 00:00:00 2001 From: MtH Date: Thu, 15 Apr 2021 04:24:32 +0200 Subject: [PATCH 6/7] sus cliprect frameWidth / Height --- source/PlayState.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 8403128a3..1e4bcd0de 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2138,16 +2138,16 @@ class PlayState extends MusicBeatState if (daNote.animation.curAnim.name.endsWith("end") && daNote.prevNote != null) daNote.y += daNote.prevNote.height; else - daNote.y += daNote.height / daNote.scale.y; + daNote.y += daNote.height / 2; if ((!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit))) && daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= strumLineMid) { - // div by scale because cliprect is affected by scale i THINK - var swagRect:FlxRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y); + // clipRect is applied to graphic itself so use frame Heights + var swagRect:FlxRect = new FlxRect(0, 0, daNote.frameWidth, daNote.frameHeight); swagRect.height = (strumLineMid - daNote.y) / daNote.scale.y; - swagRect.y = daNote.height / daNote.scale.y - swagRect.height; + swagRect.y = daNote.frameHeight - swagRect.height; daNote.clipRect = swagRect; } } From f7bb96c49c08e1bc626454ccd3c8ab43162858b0 Mon Sep 17 00:00:00 2001 From: MtH Date: Thu, 15 Apr 2021 16:19:02 +0200 Subject: [PATCH 7/7] menu back sounds on all menus --- source/FreeplayState.hx | 1 + source/ui/OptionsState.hx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index fccfcc440..05eb6e2b7 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -234,6 +234,7 @@ class FreeplayState extends MusicBeatState if (controls.BACK) { + FlxG.sound.play(Paths.sound('cancelMenu')); FlxG.switchState(new MainMenuState()); } diff --git a/source/ui/OptionsState.hx b/source/ui/OptionsState.hx index da51df269..ce28f5a31 100644 --- a/source/ui/OptionsState.hx +++ b/source/ui/OptionsState.hx @@ -137,7 +137,10 @@ class Page extends FlxGroup function updateEnabled(elapsed:Float) { if (canExit && controls.BACK) + { + FlxG.sound.play(Paths.sound('cancelMenu')); exit(); + } } function set_enabled(value:Bool)