From c653c697202cdeb51a1301b2b9369ca3992544d2 Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Sat, 13 Mar 2021 19:40:54 +0100 Subject: [PATCH 01/11] week6 dialogue finger --- source/DialogueBox.hx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index 929eb242e..1e56367af 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -120,7 +120,10 @@ class DialogueBox extends FlxSpriteGroup box.screenCenter(X); portraitLeft.screenCenter(X); - handSelect = new FlxSprite(FlxG.width * 0.9, FlxG.height * 0.9).loadGraphic(Paths.image('weeb/pixelUI/hand_textbox')); + handSelect = new FlxSprite(1042, 590).loadGraphic(Paths.image('weeb/pixelUI/hand_textbox')); + handSelect.setGraphicSize(Std.int(handSelect.width * PlayState.daPixelZoom * 0.9)); + handSelect.updateHitbox(); + handSelect.visible = false; add(handSelect); @@ -230,7 +233,13 @@ class DialogueBox extends FlxSpriteGroup // swagDialogue.text = ; swagDialogue.resetText(dialogueList[0]); - swagDialogue.start(0.04, true); + swagDialogue.start(0.04); + swagDialogue.completeCallback = function() + { + trace("dialogue finish"); + handSelect.visible = true; + }; + handSelect.visible = false; switch (curCharacter) { From 30ef3e495565174c2693288ff399b10ddbee3a2b Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Sat, 13 Mar 2021 19:43:11 +0100 Subject: [PATCH 02/11] freeplay monster icon --- source/FreeplayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 2e3d98c50..bfd67d31c 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -59,7 +59,7 @@ class FreeplayState extends MusicBeatState addWeek(['Bopeebo', 'Fresh', 'Dadbattle'], 1, ['dad']); if (StoryMenuState.weekUnlocked[2] || isDebug) - addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky']); + addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky', 'spooky', 'monster']); if (StoryMenuState.weekUnlocked[3] || isDebug) addWeek(['Pico', 'Philly', 'Blammed'], 3, ['pico']); From 53b5153c2245b827ada2e2bf8e1bd32fd12c9177 Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Sat, 13 Mar 2021 19:48:49 +0100 Subject: [PATCH 03/11] finger fadeout oops --- source/DialogueBox.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index 1e56367af..104b10a8b 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -202,6 +202,7 @@ class DialogueBox extends FlxSpriteGroup portraitLeft.visible = false; portraitRight.visible = false; swagDialogue.alpha -= 1 / 5; + handSelect.alpha -= 1 / 5; dropText.alpha = swagDialogue.alpha; }, 5); From 9885b03b7d1d0b2d27969345dc4f56496dbf0426 Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Sat, 13 Mar 2021 20:06:03 +0100 Subject: [PATCH 04/11] portraits before box to fix thorns intro layering issue --- source/DialogueBox.hx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index 104b10a8b..ade30a8e3 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -60,6 +60,24 @@ class DialogueBox extends FlxSpriteGroup bgFade.alpha = 0.7; }, 5); + portraitLeft = new FlxSprite(-20, 40); + portraitLeft.frames = Paths.getSparrowAtlas('weeb/senpaiPortrait'); + portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false); + portraitLeft.setGraphicSize(Std.int(portraitLeft.width * PlayState.daPixelZoom * 0.9)); + portraitLeft.updateHitbox(); + portraitLeft.scrollFactor.set(); + add(portraitLeft); + portraitLeft.visible = false; + + portraitRight = new FlxSprite(0, 40); + portraitRight.frames = Paths.getSparrowAtlas('weeb/bfPortrait'); + portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false); + portraitRight.setGraphicSize(Std.int(portraitRight.width * PlayState.daPixelZoom * 0.9)); + portraitRight.updateHitbox(); + portraitRight.scrollFactor.set(); + add(portraitRight); + portraitRight.visible = false; + box = new FlxSprite(-20, 45); var hasDialog = false; @@ -94,24 +112,6 @@ class DialogueBox extends FlxSpriteGroup if (!hasDialog) return; - portraitLeft = new FlxSprite(-20, 40); - portraitLeft.frames = Paths.getSparrowAtlas('weeb/senpaiPortrait'); - portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false); - portraitLeft.setGraphicSize(Std.int(portraitLeft.width * PlayState.daPixelZoom * 0.9)); - portraitLeft.updateHitbox(); - portraitLeft.scrollFactor.set(); - add(portraitLeft); - portraitLeft.visible = false; - - portraitRight = new FlxSprite(0, 40); - portraitRight.frames = Paths.getSparrowAtlas('weeb/bfPortrait'); - portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false); - portraitRight.setGraphicSize(Std.int(portraitRight.width * PlayState.daPixelZoom * 0.9)); - portraitRight.updateHitbox(); - portraitRight.scrollFactor.set(); - add(portraitRight); - portraitRight.visible = false; - box.animation.play('normalOpen'); box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 0.9)); box.updateHitbox(); From 367cb8b1cce1281e75d72356cc97931f8c377e1a Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Sat, 13 Mar 2021 22:31:34 +0100 Subject: [PATCH 05/11] make main menu bg not go offscreen when selecting options, add offsets for menu items --- source/MainMenuState.hx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 4b3a8f110..369af2e87 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -45,7 +45,7 @@ class MainMenuState extends MusicBeatState var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG')); bg.scrollFactor.x = 0; - bg.scrollFactor.y = 0.18; + bg.scrollFactor.y = 0.17; bg.setGraphicSize(Std.int(bg.width * 1.1)); bg.updateHitbox(); bg.screenCenter(); @@ -57,7 +57,7 @@ class MainMenuState extends MusicBeatState magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat')); magenta.scrollFactor.x = 0; - magenta.scrollFactor.y = 0.18; + magenta.scrollFactor.y = 0.17; magenta.setGraphicSize(Std.int(magenta.width * 1.1)); magenta.updateHitbox(); magenta.screenCenter(); @@ -208,11 +208,25 @@ class MainMenuState extends MusicBeatState if (spr.ID == curSelected) { - spr.animation.play('selected'); camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y); + spr.animation.play('selected'); } spr.updateHitbox(); + if(spr.animation.curAnim.name == 'selected') + { + switch(optionShit[curSelected]) + { + case 'story mode': + spr.offset.y += 26; + case 'freeplay': + spr.offset.y += 28; + case 'donate': + spr.offset.y += 21; + case 'options': + spr.offset.y += 26; + } + } }); } } From c3710025e1cc6632900291f550c6b1f6eab07026 Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Sun, 14 Mar 2021 20:46:44 +0100 Subject: [PATCH 06/11] fix oppenent freezing when !mustHitSection and no notes, dance only on downbeat --- source/PlayState.hx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index c864df782..f0ecd23b4 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2289,10 +2289,6 @@ class PlayState extends MusicBeatState } // else // Conductor.changeBPM(SONG.bpm); - - // Dad doesnt interupt his own notes - if (SONG.notes[Math.floor(curStep / 16)].mustHitSection) - dad.dance(); } // FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM); wiggleShit.update(Conductor.crochet); @@ -2321,9 +2317,17 @@ class PlayState extends MusicBeatState gf.dance(); } - if (!boyfriend.animation.curAnim.name.startsWith("sing")) + if (curBeat % 2 == 0) { - boyfriend.playAnim('idle'); + if (!boyfriend.animation.curAnim.name.startsWith("sing")) + boyfriend.playAnim('idle'); + if (!dad.animation.curAnim.name.startsWith("sing")) + dad.dance(); + } + else if (dad.curCharacter == 'spooky') + { + if (!dad.animation.curAnim.name.startsWith("sing")) + dad.dance(); } if (curBeat % 8 == 7 && curSong == 'Bopeebo') From 1467335ac74d628b9c505b9e60de01e613c87b4e Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Sun, 14 Mar 2021 20:48:02 +0100 Subject: [PATCH 07/11] remove check if philly train sound playing --- source/PlayState.hx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index f0ecd23b4..fc0103c61 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2198,8 +2198,7 @@ class PlayState extends MusicBeatState function trainStart():Void { trainMoving = true; - if (!trainSound.playing) - trainSound.play(true); + trainSound.play(true); } var startedMoving:Bool = false; From 91409b67c9a73c4b387bc13ab3433289b874dbe6 Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Wed, 17 Mar 2021 18:33:26 +0100 Subject: [PATCH 08/11] mitigate countdown dancing issues (might still fuck up on higher bpm) --- source/MusicBeatState.hx | 2 +- source/MusicBeatSubstate.hx | 2 +- source/PlayState.hx | 80 +++++++++++++++++++++---------------- 3 files changed, 47 insertions(+), 37 deletions(-) diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index 88c58a624..1c7359798 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -35,7 +35,7 @@ class MusicBeatState extends FlxUIState updateCurStep(); updateBeat(); - if (oldStep != curStep && curStep > 0) + if (oldStep != curStep && curStep >= 0) stepHit(); super.update(elapsed); diff --git a/source/MusicBeatSubstate.hx b/source/MusicBeatSubstate.hx index c6da0fb59..480d6ed16 100644 --- a/source/MusicBeatSubstate.hx +++ b/source/MusicBeatSubstate.hx @@ -29,7 +29,7 @@ class MusicBeatSubstate extends FlxSubState updateCurStep(); curBeat = Math.floor(curStep / 4); - if (oldStep != curStep && curStep > 0) + if (oldStep != curStep && curStep >= 0) stepHit(); diff --git a/source/PlayState.hx b/source/PlayState.hx index baea8bf77..ce428753f 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -908,9 +908,18 @@ class PlayState extends MusicBeatState startTimer = new FlxTimer().start(Conductor.crochet / 1000, function(tmr:FlxTimer) { - dad.dance(); - gf.dance(); - boyfriend.playAnim('idle'); + // this just based on beatHit stuff but compact + if (swagCounter % gfSpeed == 0) + gf.dance(); + if (swagCounter % 2 == 0) + { + if (!boyfriend.animation.curAnim.name.startsWith("sing")) + boyfriend.playAnim('idle'); + if (!dad.animation.curAnim.name.startsWith("sing")) + dad.dance(); + } + else if (dad.curCharacter == 'spooky' && !dad.animation.curAnim.name.startsWith("sing")) + dad.dance(); var introAssets:Map<String, Array<String>> = new Map<String, Array<String>>(); introAssets.set('default', ['ready', "set", "go"]); @@ -1286,6 +1295,39 @@ class PlayState extends MusicBeatState iconP1.animation.play('bf-old'); } + // do this BEFORE super.update() so songPosition is accurate + if (startingSong) + { + if (startedCountdown) + { + Conductor.songPosition += FlxG.elapsed * 1000; + if (Conductor.songPosition >= 0) + startSong(); + } + } + else + { + // Conductor.songPosition = FlxG.sound.music.time; + Conductor.songPosition += FlxG.elapsed * 1000; + + if (!paused) + { + songTime += FlxG.game.ticks - previousFrameTime; + previousFrameTime = FlxG.game.ticks; + + // Interpolation type beat + if (Conductor.lastSongPos != Conductor.songPosition) + { + songTime = (songTime + Conductor.songPosition) / 2; + Conductor.lastSongPos = Conductor.songPosition; + // Conductor.songPosition += FlxG.elapsed * 1000; + // trace('MISSED FRAME'); + } + } + + // Conductor.lastSongPos = FlxG.sound.music.time; + } + switch (curStage) { case 'philly': @@ -1362,38 +1404,6 @@ class PlayState extends MusicBeatState FlxG.switchState(new AnimationDebug(SONG.player2)); #end - if (startingSong) - { - if (startedCountdown) - { - Conductor.songPosition += FlxG.elapsed * 1000; - if (Conductor.songPosition >= 0) - startSong(); - } - } - else - { - // Conductor.songPosition = FlxG.sound.music.time; - Conductor.songPosition += FlxG.elapsed * 1000; - - if (!paused) - { - songTime += FlxG.game.ticks - previousFrameTime; - previousFrameTime = FlxG.game.ticks; - - // Interpolation type beat - if (Conductor.lastSongPos != Conductor.songPosition) - { - songTime = (songTime + Conductor.songPosition) / 2; - Conductor.lastSongPos = Conductor.songPosition; - // Conductor.songPosition += FlxG.elapsed * 1000; - // trace('MISSED FRAME'); - } - } - - // Conductor.lastSongPos = FlxG.sound.music.time; - } - if (generatedMusic && PlayState.SONG.notes[Std.int(curStep / 16)] != null) { if (curBeat % 4 == 0) From 3107d62053246bb8dc263fd178f6dc8140f1663d Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Wed, 17 Mar 2021 19:15:00 +0100 Subject: [PATCH 09/11] make pause actually use the pause control --- source/PlayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index ce428753f..2a678c8de 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1348,7 +1348,7 @@ class PlayState extends MusicBeatState scoreTxt.text = "Score:" + songScore; - if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause) + if (controls.PAUSE && startedCountdown && canPause) { persistentUpdate = false; persistentDraw = true; From 6e23041d8c45e3f595e940b61034eb01615d11e7 Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Thu, 18 Mar 2021 12:49:37 +0100 Subject: [PATCH 10/11] title tweaks: fix crash when spamming enter, force logo bump, compensate for missed beats with intro text (ex. when window being dragged) --- source/MusicBeatState.hx | 3 - source/MusicBeatSubstate.hx | 3 - source/TitleState.hx | 108 ++++++++++++++++++++---------------- 3 files changed, 59 insertions(+), 55 deletions(-) diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index 1c7359798..28660b160 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -9,9 +9,6 @@ import flixel.util.FlxTimer; class MusicBeatState extends FlxUIState { - private var lastBeat:Float = 0; - private var lastStep:Float = 0; - private var curStep:Int = 0; private var curBeat:Int = 0; private var controls(get, never):Controls; diff --git a/source/MusicBeatSubstate.hx b/source/MusicBeatSubstate.hx index 480d6ed16..89c4458b2 100644 --- a/source/MusicBeatSubstate.hx +++ b/source/MusicBeatSubstate.hx @@ -11,9 +11,6 @@ class MusicBeatSubstate extends FlxSubState super(); } - private var lastBeat:Float = 0; - private var lastStep:Float = 0; - private var curStep:Int = 0; private var curBeat:Int = 0; private var controls(get, never):Controls; diff --git a/source/TitleState.hx b/source/TitleState.hx index eb46ace47..8685b9560 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -34,6 +34,8 @@ class TitleState extends MusicBeatState var wackyImage:FlxSprite; + var lastBeat:Int = 0; + override public function create():Void { #if polymod @@ -304,7 +306,7 @@ class TitleState extends MusicBeatState // FlxG.sound.play(Paths.music('titleShoot'), 0.7); } - if (pressedEnter && !skippedIntro) + if (pressedEnter && !skippedIntro && initialized) { skipIntro(); } @@ -346,7 +348,7 @@ class TitleState extends MusicBeatState { super.beatHit(); - logoBl.animation.play('bump'); + logoBl.animation.play('bump', true); danceLeft = !danceLeft; if (danceLeft) @@ -355,57 +357,65 @@ class TitleState extends MusicBeatState gfDance.animation.play('danceLeft'); FlxG.log.add(curBeat); - - switch (curBeat) + // if the user is draggin the window some beats will + // be missed so this is just to compensate + if (curBeat > lastBeat) { - case 1: - createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']); - // credTextShit.visible = true; - case 3: - addMoreText('present'); - // credTextShit.text += '\npresent...'; - // credTextShit.addText(); - case 4: - deleteCoolText(); - // credTextShit.visible = false; - // credTextShit.text = 'In association \nwith'; - // credTextShit.screenCenter(); - case 5: - createCoolText(['In association', 'with']); - case 7: - addMoreText('newgrounds'); - ngSpr.visible = true; - // credTextShit.text += '\nNewgrounds'; - case 8: - deleteCoolText(); - ngSpr.visible = false; - // credTextShit.visible = false; + for (i in lastBeat...curBeat) + { + switch (i + 1) + { + case 1: + createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']); + // credTextShit.visible = true; + case 3: + addMoreText('present'); + // credTextShit.text += '\npresent...'; + // credTextShit.addText(); + case 4: + deleteCoolText(); + // credTextShit.visible = false; + // credTextShit.text = 'In association \nwith'; + // credTextShit.screenCenter(); + case 5: + createCoolText(['In association', 'with']); + case 7: + addMoreText('newgrounds'); + ngSpr.visible = true; + // credTextShit.text += '\nNewgrounds'; + case 8: + deleteCoolText(); + ngSpr.visible = false; + // credTextShit.visible = false; - // credTextShit.text = 'Shoutouts Tom Fulp'; - // credTextShit.screenCenter(); - case 9: - createCoolText([curWacky[0]]); - // credTextShit.visible = true; - case 11: - addMoreText(curWacky[1]); - // credTextShit.text += '\nlmao'; - case 12: - deleteCoolText(); - // credTextShit.visible = false; - // credTextShit.text = "Friday"; - // credTextShit.screenCenter(); - case 13: - addMoreText('Friday'); - // credTextShit.visible = true; - case 14: - addMoreText('Night'); - // credTextShit.text += '\nNight'; - case 15: - addMoreText('Funkin'); // credTextShit.text += '\nFunkin'; + // credTextShit.text = 'Shoutouts Tom Fulp'; + // credTextShit.screenCenter(); + case 9: + createCoolText([curWacky[0]]); + // credTextShit.visible = true; + case 11: + addMoreText(curWacky[1]); + // credTextShit.text += '\nlmao'; + case 12: + deleteCoolText(); + // credTextShit.visible = false; + // credTextShit.text = "Friday"; + // credTextShit.screenCenter(); + case 13: + addMoreText('Friday'); + // credTextShit.visible = true; + case 14: + addMoreText('Night'); + // credTextShit.text += '\nNight'; + case 15: + addMoreText('Funkin'); // credTextShit.text += '\nFunkin'; - case 16: - skipIntro(); + case 16: + skipIntro(); + } + } } + lastBeat = curBeat; } var skippedIntro:Bool = false; From ab1a89783ce06c3a9eb1a72b12c3523a60af8985 Mon Sep 17 00:00:00 2001 From: MtH <mth@mth.moe> Date: Thu, 18 Mar 2021 14:04:28 +0100 Subject: [PATCH 11/11] bf pixel die offset fix & manual sparrow fix --- source/Character.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Character.hx b/source/Character.hx index 86a630d49..44d35e2bb 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -408,8 +408,8 @@ class Character extends FlxSprite animation.play('firstDeath'); addOffset('firstDeath'); - addOffset('deathLoop', -37); - addOffset('deathConfirm', -37); + addOffset('deathLoop', -30, -12); + addOffset('deathConfirm', -30, -12); playAnim('firstDeath'); // pixel bullshit setGraphicSize(Std.int(width * 6));