From c90c33419aa0e1800eed88ca3ec9597e64310708 Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 19 Apr 2021 10:35:39 +0200 Subject: [PATCH 01/13] load songs from reload json button --- source/ChartingState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index d36521a6b..1030c19ba 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1038,7 +1038,7 @@ class ChartingState extends MusicBeatState function loadJson(song:String):Void { PlayState.SONG = Song.loadFromJson(song.toLowerCase(), song.toLowerCase()); - FlxG.resetState(); + LoadingState.loadAndSwitchState(new ChartingState()); } function loadAutosave():Void From 0a9a00b5bf9ff6986d30ac3184ed2f1650667741 Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 19 Apr 2021 10:43:21 +0200 Subject: [PATCH 02/13] don't play game over music if already ending --- source/GameOverSubstate.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/GameOverSubstate.hx b/source/GameOverSubstate.hx index 86123283f..7d35b6f42 100644 --- a/source/GameOverSubstate.hx +++ b/source/GameOverSubstate.hx @@ -111,7 +111,8 @@ class GameOverSubstate extends MusicBeatSubstate FlxG.sound.play(Paths.sound('jeffGameover/jeffGameover-' + randomGameover), 1, false, null, true, function() { - FlxG.sound.music.fadeIn(4, 0.2, 1); + if (!isEnding) + FlxG.sound.music.fadeIn(4, 0.2, 1); }); } default: @@ -130,7 +131,8 @@ class GameOverSubstate extends MusicBeatSubstate private function coolStartDeath(?vol:Float = 1):Void { - FlxG.sound.playMusic(Paths.music('gameOver' + stageSuffix), vol); + if (!isEnding) + FlxG.sound.playMusic(Paths.music('gameOver' + stageSuffix), vol); } override function beatHit() From 9cde6893283ff443d8809e745aaec345e1fb1a1b Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 19 Apr 2021 18:19:40 +0200 Subject: [PATCH 03/13] bf old icon switch switches back to proper player1 --- source/HealthIcon.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/HealthIcon.hx b/source/HealthIcon.hx index 883d3525c..8ebb79306 100644 --- a/source/HealthIcon.hx +++ b/source/HealthIcon.hx @@ -34,7 +34,7 @@ class HealthIcon extends FlxSprite if (isOldIcon) changeIcon('bf-old'); else - changeIcon('bf'); + changeIcon(PlayState.SONG.player1); } public function changeIcon(newChar:String):Void From 8186f73c56a08af3cb0a00f07ef737c838966c49 Mon Sep 17 00:00:00 2001 From: MtH Date: Mon, 19 Apr 2021 19:11:30 +0200 Subject: [PATCH 04/13] cam lerp on gameover --- source/GameOverSubstate.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/GameOverSubstate.hx b/source/GameOverSubstate.hx index 7d35b6f42..9bf0c466a 100644 --- a/source/GameOverSubstate.hx +++ b/source/GameOverSubstate.hx @@ -70,6 +70,9 @@ class GameOverSubstate extends MusicBeatSubstate override function update(elapsed:Float) { + // makes the lerp non-dependant on the framerate + FlxG.camera.followLerp = CoolUtil.camLerpShit(0.01); + super.update(elapsed); if (controls.ACCEPT) @@ -96,7 +99,7 @@ class GameOverSubstate extends MusicBeatSubstate if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.curFrame == 12) { - FlxG.camera.follow(camFollow, LOCKON, 0.01); + FlxG.camera.follow(camFollow, LOCKON, CoolUtil.camLerpShit(0.01)); } switch (PlayState.storyWeek) From 8af89167f71803d52ac5d929729caa24c64829b9 Mon Sep 17 00:00:00 2001 From: MtH Date: Tue, 20 Apr 2021 17:55:42 +0200 Subject: [PATCH 05/13] note miss stuff, clean up 'stunned' remnants --- source/Boyfriend.hx | 2 +- source/PlayState.hx | 93 ++++++++++++++++++++++++--------------------- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/source/Boyfriend.hx b/source/Boyfriend.hx index 3421367cb..222e06d72 100644 --- a/source/Boyfriend.hx +++ b/source/Boyfriend.hx @@ -9,7 +9,7 @@ using StringTools; class Boyfriend extends Character { - public var stunned:Bool = false; + // public var stunned:Bool = false; public function new(x:Float, y:Float, ?char:String = 'bf') { diff --git a/source/PlayState.hx b/source/PlayState.hx index 3291808ae..8e6d7fc90 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2162,7 +2162,7 @@ class PlayState extends MusicBeatState if (health <= 0 && !practiceMode) { - boyfriend.stunned = true; + // boyfriend.stunned = true; persistentUpdate = false; persistentDraw = false; @@ -2199,7 +2199,8 @@ class PlayState extends MusicBeatState { notes.forEachAlive(function(daNote:Note) { - if (daNote.y > FlxG.height) + if ((PreferencesMenu.getPref('downscroll') && daNote.y < -daNote.height) + || (!PreferencesMenu.getPref('downscroll') && daNote.y > FlxG.height)) { daNote.active = false; daNote.visible = false; @@ -2292,17 +2293,19 @@ class PlayState extends MusicBeatState // WIP interpolation shit? Need to fix the pause issue // daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * SONG.speed)); - var noteMiss:Bool = daNote.y < -daNote.height; + // removing this so whether the note misses or not is entirely up to Note class + // var noteMiss:Bool = daNote.y < -daNote.height; - if (PreferencesMenu.getPref('downscroll')) - noteMiss = daNote.y > FlxG.height; + // if (PreferencesMenu.getPref('downscroll')) + // noteMiss = daNote.y > FlxG.height; - if (noteMiss) + if (daNote.tooLate || daNote.wasGoodHit) { - if (daNote.tooLate || !daNote.wasGoodHit) + if (daNote.tooLate) { health -= 0.0475; vocals.volume = 0; + killCombo(); } daNote.active = false; @@ -2324,6 +2327,13 @@ class PlayState extends MusicBeatState #end } + function killCombo():Void + { + if (combo > 5 && gf.animOffsets.exists('sad')) + gf.playAnim('sad'); + combo = 0; + } + function endSong():Void { seenCutscene = false; @@ -2725,7 +2735,7 @@ class PlayState extends MusicBeatState for (shit in 0...pressArray.length) { // if a direction is hit that shouldn't be if (pressArray[shit] && !directionList.contains(shit)) - badNoteHit(); + noteMiss(shit); } for (coolNote in possibleNotes) { @@ -2735,7 +2745,9 @@ class PlayState extends MusicBeatState } else { - badNoteHit(); + for (shit in 0...pressArray.length) + if (pressArray[shit]) + noteMiss(shit); } } @@ -2767,44 +2779,39 @@ class PlayState extends MusicBeatState function noteMiss(direction:Int = 1):Void { - if (!boyfriend.stunned) + // whole function used to be encased in if (!boyfriend.stunned) + health -= 0.04; + killCombo(); + + if (!practiceMode) + songScore -= 10; + + vocals.volume = 0; + FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2)); + + /* boyfriend.stunned = true; + + // get stunned for 5 seconds + new FlxTimer().start(5 / 60, function(tmr:FlxTimer) { - health -= 0.04; - if (combo > 5 && gf.animOffsets.exists('sad')) - { - gf.playAnim('sad'); - } - combo = 0; + boyfriend.stunned = false; + }); */ - if (!practiceMode) - songScore -= 10; - - FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2)); - // FlxG.sound.play(Paths.sound('missnote1'), 1, false); - // FlxG.log.add('played imss note'); - - boyfriend.stunned = true; - - // get stunned for 5 seconds - new FlxTimer().start(5 / 60, function(tmr:FlxTimer) - { - boyfriend.stunned = false; - }); - - switch (direction) - { - case 0: - boyfriend.playAnim('singLEFTmiss', true); - case 1: - boyfriend.playAnim('singDOWNmiss', true); - case 2: - boyfriend.playAnim('singUPmiss', true); - case 3: - boyfriend.playAnim('singRIGHTmiss', true); - } + switch (direction) + { + case 0: + boyfriend.playAnim('singLEFTmiss', true); + case 1: + boyfriend.playAnim('singDOWNmiss', true); + case 2: + boyfriend.playAnim('singUPmiss', true); + case 3: + boyfriend.playAnim('singRIGHTmiss', true); } } + /* not used anymore lol + function badNoteHit() { // just double pasting this shit cuz fuk u @@ -2822,7 +2829,7 @@ class PlayState extends MusicBeatState noteMiss(2); if (rightP) noteMiss(3); - } + } */ function goodNoteHit(note:Note):Void { From 1630878f343eaa6570b30734d8eaaa6bc7d4d467 Mon Sep 17 00:00:00 2001 From: MtH Date: Tue, 20 Apr 2021 20:38:07 +0200 Subject: [PATCH 06/13] combo counter fixes & tweaks --- source/PlayState.hx | 148 ++++++++++++++++++++++++-------------------- 1 file changed, 81 insertions(+), 67 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 8e6d7fc90..c6af06add 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2331,7 +2331,11 @@ class PlayState extends MusicBeatState { if (combo > 5 && gf.animOffsets.exists('sad')) gf.playAnim('sad'); - combo = 0; + if (combo != 0) + { + combo = 0; + displayCombo(); + } } function endSong():Void @@ -2431,19 +2435,13 @@ class PlayState extends MusicBeatState } } + // gives score and pops up rating private function popUpScore(strumtime:Float, daNote:Note):Void { var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition); // boyfriend.playAnim('hey'); vocals.volume = 1; - var placement:String = Std.string(combo); - - var coolText:FlxText = new FlxText(0, 0, 0, placement, 32); - coolText.screenCenter(); - coolText.x = FlxG.width * 0.55; - // - var rating:FlxSprite = new FlxSprite(); var score:Int = 350; @@ -2490,6 +2488,45 @@ class PlayState extends MusicBeatState daRating = 'bad'; */ + var ratingPath:String = daRating; + + if (curStage.startsWith('school')) + ratingPath = "weeb/pixelUI/" + ratingPath + "-pixel"; + + rating.loadGraphic(Paths.image(ratingPath)); + rating.screenCenter(); + rating.x = FlxG.width * 0.55 - 40; + rating.y -= 60; + rating.acceleration.y = 550; + rating.velocity.y -= FlxG.random.int(140, 175); + rating.velocity.x -= FlxG.random.int(0, 10); + + add(rating); + + if (curStage.startsWith('school')) + { + rating.setGraphicSize(Std.int(rating.width * daPixelZoom * 0.7)); + } + else + { + rating.setGraphicSize(Std.int(rating.width * 0.7)); + rating.antialiasing = true; + } + rating.updateHitbox(); + + FlxTween.tween(rating, {alpha: 0}, 0.2, { + onComplete: function(tween:FlxTween) + { + rating.destroy(); + }, + startDelay: Conductor.crochet * 0.001 + }); + if (combo >= 10 || combo == 0) + displayCombo(); + } + + function displayCombo():Void + { var pixelShitPart1:String = ""; var pixelShitPart2:String = ''; @@ -2499,70 +2536,71 @@ class PlayState extends MusicBeatState pixelShitPart2 = '-pixel'; } - rating.loadGraphic(Paths.image(pixelShitPart1 + daRating + pixelShitPart2)); - rating.screenCenter(); - rating.x = coolText.x - 40; - rating.y -= 60; - rating.acceleration.y = 550; - rating.velocity.y -= FlxG.random.int(140, 175); - rating.velocity.x -= FlxG.random.int(0, 10); - var comboSpr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'combo' + pixelShitPart2)); comboSpr.screenCenter(); - comboSpr.x = coolText.x; + comboSpr.x = FlxG.width * 0.55; + comboSpr.y += 80; comboSpr.acceleration.y = 600; comboSpr.velocity.y -= 150; - comboSpr.velocity.x += FlxG.random.int(1, 10); - add(rating); - if (!curStage.startsWith('school')) + add(comboSpr); + + if (curStage.startsWith('school')) { - rating.setGraphicSize(Std.int(rating.width * 0.7)); - rating.antialiasing = true; - comboSpr.setGraphicSize(Std.int(comboSpr.width * 0.7)); - comboSpr.antialiasing = true; + comboSpr.setGraphicSize(Std.int(comboSpr.width * daPixelZoom * 0.7)); } else { - rating.setGraphicSize(Std.int(rating.width * daPixelZoom * 0.7)); - comboSpr.setGraphicSize(Std.int(comboSpr.width * daPixelZoom * 0.7)); + comboSpr.setGraphicSize(Std.int(comboSpr.width * 0.7)); + comboSpr.antialiasing = true; } - comboSpr.updateHitbox(); - rating.updateHitbox(); + + FlxTween.tween(comboSpr, {alpha: 0}, 0.2, { + onComplete: function(tween:FlxTween) + { + comboSpr.destroy(); + }, + startDelay: Conductor.crochet * 0.001 + }); var seperatedScore:Array = []; + var tempCombo:Int = combo; - seperatedScore.push(Math.floor(combo / 100)); - seperatedScore.push(Math.floor((combo - (seperatedScore[0] * 100)) / 10)); - seperatedScore.push(combo % 10); + while (tempCombo != 0) + { + seperatedScore.push(tempCombo % 10); + tempCombo = Std.int(tempCombo / 10); + } + while (seperatedScore.length < 3) + seperatedScore.push(0); - var daLoop:Int = 0; + // seperatedScore.reverse(); + + var daLoop:Int = 1; for (i in seperatedScore) { var numScore:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'num' + Std.int(i) + pixelShitPart2)); - numScore.screenCenter(); - numScore.x = coolText.x + (43 * daLoop) - 90; - numScore.y += 80; + numScore.y = comboSpr.y; - if (!curStage.startsWith('school')) + if (curStage.startsWith('school')) + { + numScore.setGraphicSize(Std.int(numScore.width * daPixelZoom)); + } + else { numScore.antialiasing = true; numScore.setGraphicSize(Std.int(numScore.width * 0.5)); } - else - { - numScore.setGraphicSize(Std.int(numScore.width * daPixelZoom)); - } numScore.updateHitbox(); + numScore.x = comboSpr.x - (43 * daLoop); //- 90; numScore.acceleration.y = FlxG.random.int(200, 300); numScore.velocity.y -= FlxG.random.int(140, 160); numScore.velocity.x = FlxG.random.float(-5, 5); - if (combo >= 10 || combo == 0) - add(numScore); + add(numScore); FlxTween.tween(numScore, {alpha: 0}, 0.2, { onComplete: function(tween:FlxTween) @@ -2574,30 +2612,6 @@ class PlayState extends MusicBeatState daLoop++; } - /* - trace(combo); - trace(seperatedScore); - */ - - coolText.text = Std.string(seperatedScore); - // add(coolText); - - FlxTween.tween(rating, {alpha: 0}, 0.2, { - startDelay: Conductor.crochet * 0.001 - }); - - FlxTween.tween(comboSpr, {alpha: 0}, 0.2, { - onComplete: function(tween:FlxTween) - { - coolText.destroy(); - comboSpr.destroy(); - - rating.destroy(); - }, - startDelay: Conductor.crochet * 0.001 - }); - - curSection += 1; } var cameraRightSide:Bool = false; @@ -2837,8 +2851,8 @@ class PlayState extends MusicBeatState { if (!note.isSustainNote) { - popUpScore(note.strumTime, note); combo += 1; + popUpScore(note.strumTime, note); } if (note.noteData >= 0) From aabaf2062c88c55d659f22d84d39ed24d6cfc7cb Mon Sep 17 00:00:00 2001 From: MtH Date: Tue, 20 Apr 2021 20:38:07 +0200 Subject: [PATCH 07/13] combo counter fixes & tweaks --- source/PlayState.hx | 147 ++++++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 67 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 8e6d7fc90..652466c77 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2331,7 +2331,11 @@ class PlayState extends MusicBeatState { if (combo > 5 && gf.animOffsets.exists('sad')) gf.playAnim('sad'); - combo = 0; + if (combo != 0) + { + combo = 0; + displayCombo(); + } } function endSong():Void @@ -2431,19 +2435,13 @@ class PlayState extends MusicBeatState } } + // gives score and pops up rating private function popUpScore(strumtime:Float, daNote:Note):Void { var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition); // boyfriend.playAnim('hey'); vocals.volume = 1; - var placement:String = Std.string(combo); - - var coolText:FlxText = new FlxText(0, 0, 0, placement, 32); - coolText.screenCenter(); - coolText.x = FlxG.width * 0.55; - // - var rating:FlxSprite = new FlxSprite(); var score:Int = 350; @@ -2490,6 +2488,45 @@ class PlayState extends MusicBeatState daRating = 'bad'; */ + var ratingPath:String = daRating; + + if (curStage.startsWith('school')) + ratingPath = "weeb/pixelUI/" + ratingPath + "-pixel"; + + rating.loadGraphic(Paths.image(ratingPath)); + rating.screenCenter(); + rating.x = FlxG.width * 0.55 - 40; + rating.y -= 60; + rating.acceleration.y = 550; + rating.velocity.y -= FlxG.random.int(140, 175); + rating.velocity.x -= FlxG.random.int(0, 10); + + add(rating); + + if (curStage.startsWith('school')) + { + rating.setGraphicSize(Std.int(rating.width * daPixelZoom * 0.7)); + } + else + { + rating.setGraphicSize(Std.int(rating.width * 0.7)); + rating.antialiasing = true; + } + rating.updateHitbox(); + + FlxTween.tween(rating, {alpha: 0}, 0.2, { + onComplete: function(tween:FlxTween) + { + rating.destroy(); + }, + startDelay: Conductor.crochet * 0.001 + }); + if (combo >= 10 || combo == 0) + displayCombo(); + } + + function displayCombo():Void + { var pixelShitPart1:String = ""; var pixelShitPart2:String = ''; @@ -2499,70 +2536,70 @@ class PlayState extends MusicBeatState pixelShitPart2 = '-pixel'; } - rating.loadGraphic(Paths.image(pixelShitPart1 + daRating + pixelShitPart2)); - rating.screenCenter(); - rating.x = coolText.x - 40; - rating.y -= 60; - rating.acceleration.y = 550; - rating.velocity.y -= FlxG.random.int(140, 175); - rating.velocity.x -= FlxG.random.int(0, 10); - var comboSpr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'combo' + pixelShitPart2)); comboSpr.screenCenter(); - comboSpr.x = coolText.x; + comboSpr.x = FlxG.width * 0.55; comboSpr.acceleration.y = 600; comboSpr.velocity.y -= 150; - comboSpr.velocity.x += FlxG.random.int(1, 10); - add(rating); - if (!curStage.startsWith('school')) + add(comboSpr); + + if (curStage.startsWith('school')) { - rating.setGraphicSize(Std.int(rating.width * 0.7)); - rating.antialiasing = true; - comboSpr.setGraphicSize(Std.int(comboSpr.width * 0.7)); - comboSpr.antialiasing = true; + comboSpr.setGraphicSize(Std.int(comboSpr.width * daPixelZoom * 0.7)); } else { - rating.setGraphicSize(Std.int(rating.width * daPixelZoom * 0.7)); - comboSpr.setGraphicSize(Std.int(comboSpr.width * daPixelZoom * 0.7)); + comboSpr.setGraphicSize(Std.int(comboSpr.width * 0.7)); + comboSpr.antialiasing = true; } - comboSpr.updateHitbox(); - rating.updateHitbox(); + + FlxTween.tween(comboSpr, {alpha: 0}, 0.2, { + onComplete: function(tween:FlxTween) + { + comboSpr.destroy(); + }, + startDelay: Conductor.crochet * 0.001 + }); var seperatedScore:Array = []; + var tempCombo:Int = combo; - seperatedScore.push(Math.floor(combo / 100)); - seperatedScore.push(Math.floor((combo - (seperatedScore[0] * 100)) / 10)); - seperatedScore.push(combo % 10); + while (tempCombo != 0) + { + seperatedScore.push(tempCombo % 10); + tempCombo = Std.int(tempCombo / 10); + } + while (seperatedScore.length < 3) + seperatedScore.push(0); - var daLoop:Int = 0; + // seperatedScore.reverse(); + + var daLoop:Int = 1; for (i in seperatedScore) { var numScore:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'num' + Std.int(i) + pixelShitPart2)); - numScore.screenCenter(); - numScore.x = coolText.x + (43 * daLoop) - 90; - numScore.y += 80; + numScore.y = comboSpr.y + 80; - if (!curStage.startsWith('school')) + if (curStage.startsWith('school')) + { + numScore.setGraphicSize(Std.int(numScore.width * daPixelZoom)); + } + else { numScore.antialiasing = true; numScore.setGraphicSize(Std.int(numScore.width * 0.5)); } - else - { - numScore.setGraphicSize(Std.int(numScore.width * daPixelZoom)); - } numScore.updateHitbox(); + numScore.x = comboSpr.x - (43 * daLoop); //- 90; numScore.acceleration.y = FlxG.random.int(200, 300); numScore.velocity.y -= FlxG.random.int(140, 160); numScore.velocity.x = FlxG.random.float(-5, 5); - if (combo >= 10 || combo == 0) - add(numScore); + add(numScore); FlxTween.tween(numScore, {alpha: 0}, 0.2, { onComplete: function(tween:FlxTween) @@ -2574,30 +2611,6 @@ class PlayState extends MusicBeatState daLoop++; } - /* - trace(combo); - trace(seperatedScore); - */ - - coolText.text = Std.string(seperatedScore); - // add(coolText); - - FlxTween.tween(rating, {alpha: 0}, 0.2, { - startDelay: Conductor.crochet * 0.001 - }); - - FlxTween.tween(comboSpr, {alpha: 0}, 0.2, { - onComplete: function(tween:FlxTween) - { - coolText.destroy(); - comboSpr.destroy(); - - rating.destroy(); - }, - startDelay: Conductor.crochet * 0.001 - }); - - curSection += 1; } var cameraRightSide:Bool = false; @@ -2837,8 +2850,8 @@ class PlayState extends MusicBeatState { if (!note.isSustainNote) { - popUpScore(note.strumTime, note); combo += 1; + popUpScore(note.strumTime, note); } if (note.noteData >= 0) From a280301809c7d1fd88a25a363d6525c8ba0bce8a Mon Sep 17 00:00:00 2001 From: MtH Date: Tue, 20 Apr 2021 22:25:38 +0200 Subject: [PATCH 08/13] fix susnotes after note miss changes oops --- source/PlayState.hx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 0d073bec7..a4c793c04 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2299,7 +2299,20 @@ class PlayState extends MusicBeatState // if (PreferencesMenu.getPref('downscroll')) // noteMiss = daNote.y > FlxG.height; - if (daNote.tooLate || daNote.wasGoodHit) + if (daNote.isSustainNote && daNote.wasGoodHit) + { + if ((!PreferencesMenu.getPref('downscroll') && daNote.y < -daNote.height) + || (PreferencesMenu.getPref('downscroll') && daNote.y > FlxG.height)) + { + daNote.active = false; + daNote.visible = false; + + daNote.kill(); + notes.remove(daNote, true); + daNote.destroy(); + } + } + else if (daNote.tooLate || daNote.wasGoodHit) { if (daNote.tooLate) { From 0d076e186ae9eba95317c50dec482850e07b9ae4 Mon Sep 17 00:00:00 2001 From: MtH Date: Wed, 21 Apr 2021 15:07:36 +0200 Subject: [PATCH 09/13] wocky slush debug shit, gf in animdebug, changesection --- source/PlayState.hx | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index a4c793c04..36cd9fe7e 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -77,7 +77,6 @@ class PlayState extends MusicBeatState private var unspawnNotes:Array = []; private var strumLine:FlxSprite; - private var curSection:Int = 0; private var camFollow:FlxObject; @@ -2089,11 +2088,21 @@ class PlayState extends MusicBeatState #if debug if (FlxG.keys.justPressed.EIGHT) { + /* 8 for opponent char + SHIFT+8 for player char + CTRL+SHIFT+8 for gf */ if (FlxG.keys.pressed.SHIFT) - FlxG.switchState(new AnimationDebug(SONG.player1)); + if (FlxG.keys.pressed.CONTROL) + FlxG.switchState(new AnimationDebug(gf.curCharacter)); + else + FlxG.switchState(new AnimationDebug(SONG.player1)); else FlxG.switchState(new AnimationDebug(SONG.player2)); } + if (FlxG.keys.justPressed.PAGEUP) + changeSection(1); + if (FlxG.keys.justPressed.PAGEDOWN) + changeSection(-1); #end if (generatedMusic && SONG.notes[Std.int(curStep / 16)] != null) @@ -2351,6 +2360,27 @@ class PlayState extends MusicBeatState } } + #if debug + function changeSection(sec:Int):Void + { + FlxG.sound.music.pause(); + + var daBPM:Float = SONG.bpm; + var daPos:Float = 0; + for (i in 0...(Std.int(curStep / 16 + sec))) + { + if (SONG.notes[i].changeBPM) + { + daBPM = SONG.notes[i].bpm; + } + daPos += 4 * (1000 * 60 / daBPM); + } + Conductor.songPosition = FlxG.sound.music.time = daPos; + updateCurStep(); + resyncVocals(); + } + #end + function endSong():Void { seenCutscene = false; From 2afb1a2801580140d7c88d031434cca66fd59be0 Mon Sep 17 00:00:00 2001 From: MtH Date: Wed, 21 Apr 2021 22:58:36 +0200 Subject: [PATCH 10/13] move song end into debug block --- source/PlayState.hx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 36cd9fe7e..14f8b165b 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2086,6 +2086,8 @@ class PlayState extends MusicBeatState FlxG.switchState(new Charting()); */ #if debug + if (FlxG.keys.justPressed.ONE) + endSong(); if (FlxG.keys.justPressed.EIGHT) { /* 8 for opponent char @@ -2342,11 +2344,6 @@ class PlayState extends MusicBeatState if (!inCutscene) keyShit(); - - #if debug - if (FlxG.keys.justPressed.ONE) - endSong(); - #end } function killCombo():Void From 4e47463adfcb6466e488528cf65bf2da7092a729 Mon Sep 17 00:00:00 2001 From: MtH Date: Thu, 22 Apr 2021 04:17:00 +0200 Subject: [PATCH 11/13] big cleanup --- source/FreeplayState.hx | 15 +-- source/PlayState.hx | 215 +++++++++++----------------------------- 2 files changed, 62 insertions(+), 168 deletions(-) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 05eb6e2b7..12d1e114c 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -20,7 +20,7 @@ class FreeplayState extends MusicBeatState { var songs:Array = []; - var selector:FlxText; + // var selector:FlxText; var curSelected:Int = 0; var curDifficulty:Int = 1; @@ -128,9 +128,8 @@ class FreeplayState extends MusicBeatState scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT); // scoreText.alignment = RIGHT; - scoreBG = new FlxSprite(scoreText.x - 6, 0).makeGraphic(1, 66, 0xFF000000); + scoreBG = new FlxSprite(scoreText.x - 6, 0).makeGraphic(1, 66, 0x99000000); scoreBG.antialiasing = false; - scoreBG.alpha = 0.6; add(scoreBG); diffText = new FlxText(scoreText.x, scoreText.y + 36, 0, "", 24); @@ -144,10 +143,10 @@ class FreeplayState extends MusicBeatState // FlxG.sound.playMusic(Paths.music('title'), 0); // FlxG.sound.music.fadeIn(2, 0, 0.8); - selector = new FlxText(); + // selector = new FlxText(); - selector.size = 40; - selector.text = ">"; + // selector.size = 40; + // selector.text = ">"; // add(selector); var swag:Alphabet = new Alphabet(1, 0, "swag"); @@ -216,13 +215,9 @@ class FreeplayState extends MusicBeatState var accepted = controls.ACCEPT; if (upP) - { changeSelection(-1); - } if (downP) - { changeSelection(1); - } if (FlxG.mouse.wheel != 0) changeSelection(-Math.round(FlxG.mouse.wheel / 4)); diff --git a/source/PlayState.hx b/source/PlayState.hx index 14f8b165b..1ed939cb6 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -176,14 +176,6 @@ class PlayState extends MusicBeatState FlxG.cameras.reset(camGame); FlxG.cameras.add(camHUD, false); - // fake notesplash cache type deal so that it loads in the graphic? - - grpNoteSplashes = new FlxTypedGroup(); - - var noteSplash:NoteSplash = new NoteSplash(100, 100, 0); - grpNoteSplashes.add(noteSplash); - noteSplash.alpha = 0.1; - persistentUpdate = true; persistentDraw = true; @@ -630,9 +622,7 @@ class PlayState extends MusicBeatState gfVersion = 'gf-car'; case 'mall' | 'mallEvil': gfVersion = 'gf-christmas'; - case 'school': - gfVersion = 'gf-pixel'; - case 'schoolEvil': + case 'school' | 'schoolEvil': gfVersion = 'gf-pixel'; case 'tank': gfVersion = 'gf-tankmen'; @@ -682,7 +672,6 @@ class PlayState extends MusicBeatState camPos.x += 600; tweenCamIn(); } - case "spooky": dad.y += 200; case "monster": @@ -696,11 +685,7 @@ class PlayState extends MusicBeatState dad.y += 300; case 'parents-christmas': dad.x -= 500; - case 'senpai': - dad.x += 150; - dad.y += 360; - camPos.set(dad.getGraphicMidpoint().x + 300, dad.getGraphicMidpoint().y); - case 'senpai-angry': + case 'senpai' | 'senpai-angry': dad.x += 150; dad.y += 360; camPos.set(dad.getGraphicMidpoint().x + 300, dad.getGraphicMidpoint().y); @@ -714,12 +699,6 @@ class PlayState extends MusicBeatState boyfriend = new Boyfriend(770, 450, SONG.player1); - switch (SONG.player1) - { - case "bf-holding-gf": - // boyfriend.y -= 140; - } - // REPOSITIONING PER STAGE switch (curStage) { @@ -729,10 +708,8 @@ class PlayState extends MusicBeatState resetFastCar(); add(fastCar); - case 'mall': boyfriend.x += 200; - case 'mallEvil': boyfriend.x += 320; dad.y -= 80; @@ -797,21 +774,25 @@ class PlayState extends MusicBeatState strumLine = new FlxSprite(0, 50).makeGraphic(FlxG.width, 10); if (PreferencesMenu.getPref('downscroll')) - { strumLine.y = FlxG.height - 150; // 150 just random ass number lol - } strumLine.scrollFactor.set(); strumLineNotes = new FlxTypedGroup(); add(strumLineNotes); + // fake notesplash cache type deal so that it loads in the graphic? + + grpNoteSplashes = new FlxTypedGroup(); + + var noteSplash:NoteSplash = new NoteSplash(100, 100, 0); + grpNoteSplashes.add(noteSplash); + noteSplash.alpha = 0.1; + add(grpNoteSplashes); playerStrums = new FlxTypedGroup(); - // startCountdown(); - generateSong(); // add(strumLine); @@ -916,14 +897,8 @@ class PlayState extends MusicBeatState }); }); }); - case 'senpai': + case 'senpai' | 'roses' | 'thorns': schoolIntro(doof); - case 'roses': - FlxG.sound.play(Paths.sound('ANGRY')); - schoolIntro(doof); - case 'thorns': - schoolIntro(doof); - case 'ugh': ughIntro(); case 'stress': @@ -950,7 +925,7 @@ class PlayState extends MusicBeatState default: startCountdown(); } - } + } super.create(); } @@ -1424,6 +1399,9 @@ class PlayState extends MusicBeatState add(red); camHUD.visible = false; } + else + FlxG.sound.play(Paths.sound('ANGRY')); + // moved senpai angry noise in here to clean up cutscene switch case lol } new FlxTimer().start(0.3, function(tmr:FlxTimer) @@ -1431,9 +1409,7 @@ class PlayState extends MusicBeatState black.alpha -= 0.15; if (black.alpha > 0) - { tmr.reset(0.3); - } else { if (dialogueBox != null) @@ -1448,9 +1424,7 @@ class PlayState extends MusicBeatState { senpaiEvil.alpha += 0.15; if (senpaiEvil.alpha < 1) - { swagTimer.reset(); - } else { senpaiEvil.animation.play('idle'); @@ -1472,9 +1446,7 @@ class PlayState extends MusicBeatState }); } else - { add(dialogueBox); - } } else startCountdown(); @@ -1519,91 +1491,59 @@ class PlayState extends MusicBeatState if (generatedMusic) notes.sort(sortNotes, FlxSort.DESCENDING); - var introAssets:Map> = new Map>(); - introAssets.set('default', ['ready', "set", "go"]); - introAssets.set('school', ['weeb/pixelUI/ready-pixel', 'weeb/pixelUI/set-pixel', 'weeb/pixelUI/date-pixel']); - introAssets.set('schoolEvil', ['weeb/pixelUI/ready-pixel', 'weeb/pixelUI/set-pixel', 'weeb/pixelUI/date-pixel']); - - var introAlts:Array = introAssets.get('default'); + var introSprPaths:Array = ["ready", "set", "go"]; var altSuffix:String = ""; - for (value in introAssets.keys()) + if (curStage.startsWith("school")) { - if (value == curStage) - { - introAlts = introAssets.get(value); - altSuffix = '-pixel'; - } + altSuffix = '-pixel'; + introSprPaths = ['weeb/pixelUI/ready-pixel', 'weeb/pixelUI/set-pixel', 'weeb/pixelUI/date-pixel']; } - switch (swagCounter) + var introSndPaths:Array = ["intro3" + altSuffix, "intro2" + altSuffix, + "intro1" + altSuffix, "introGo" + altSuffix]; + if (swagCounter > 0) + readySetGo(introSprPaths[swagCounter - 1]); + FlxG.sound.play(Paths.sound(introSndPaths[swagCounter]), 0.6); + + /* switch (swagCounter) { case 0: - FlxG.sound.play(Paths.sound('intro3' + altSuffix), 0.6); + case 1: - var ready:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[0])); - ready.scrollFactor.set(); - ready.updateHitbox(); - - if (curStage.startsWith('school')) - ready.setGraphicSize(Std.int(ready.width * daPixelZoom)); - - ready.screenCenter(); - add(ready); - FlxTween.tween(ready, {y: ready.y += 100, alpha: 0}, Conductor.crochet / 1000, { - ease: FlxEase.cubeInOut, - onComplete: function(twn:FlxTween) - { - ready.destroy(); - } - }); - FlxG.sound.play(Paths.sound('intro2' + altSuffix), 0.6); + case 2: - var set:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[1])); - set.scrollFactor.set(); - - if (curStage.startsWith('school')) - set.setGraphicSize(Std.int(set.width * daPixelZoom)); - - set.screenCenter(); - add(set); - FlxTween.tween(set, {y: set.y += 100, alpha: 0}, Conductor.crochet / 1000, { - ease: FlxEase.cubeInOut, - onComplete: function(twn:FlxTween) - { - set.destroy(); - } - }); - FlxG.sound.play(Paths.sound('intro1' + altSuffix), 0.6); + case 3: - var go:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[2])); - go.scrollFactor.set(); - - if (curStage.startsWith('school')) - go.setGraphicSize(Std.int(go.width * daPixelZoom)); - - go.updateHitbox(); - - go.screenCenter(); - add(go); - FlxTween.tween(go, {y: go.y += 100, alpha: 0}, Conductor.crochet / 1000, { - ease: FlxEase.cubeInOut, - onComplete: function(twn:FlxTween) - { - go.destroy(); - } - }); - FlxG.sound.play(Paths.sound('introGo' + altSuffix), 0.6); - } + + } */ swagCounter += 1; - // generateSong('fresh'); }, 4); } + function readySetGo(path:String):Void + { + var spr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(path)); + spr.scrollFactor.set(); + + if (curStage.startsWith('school')) + spr.setGraphicSize(Std.int(spr.width * daPixelZoom)); + + spr.updateHitbox(); + spr.screenCenter(); + add(spr); + FlxTween.tween(spr, {y: spr.y += 100, alpha: 0}, Conductor.crochet / 1000, { + ease: FlxEase.cubeInOut, + onComplete: function(twn:FlxTween) + { + spr.destroy(); + } + }); + } + var previousFrameTime:Int = 0; - var lastReportedPlayheadPosition:Int = 0; var songTime:Float = 0; function startSong():Void @@ -1611,7 +1551,6 @@ class PlayState extends MusicBeatState startingSong = false; previousFrameTime = FlxG.game.ticks; - lastReportedPlayheadPosition = 0; if (!paused) FlxG.sound.playMusic(Paths.inst(SONG.song), 1, false); @@ -1627,8 +1566,6 @@ class PlayState extends MusicBeatState #end } - var debugNum:Int = 0; - private function generateSong():Void { // FlxG.log.add(ChartParser.parse()); @@ -1657,13 +1594,8 @@ class PlayState extends MusicBeatState // NEW SHIT noteData = songData.notes; - var playerCounter:Int = 0; - - var daBeats:Int = 0; // Not exactly representative of 'daBeats' lol, just how much it has looped for (section in noteData) { - var coolSection:Int = Std.int(section.lengthInSteps / 4); - for (songNotes in section.sectionNotes) { var daStrumTime:Float = songNotes[0]; @@ -1672,9 +1604,7 @@ class PlayState extends MusicBeatState var gottaHitNote:Bool = section.mustHitSection; if (songNotes[1] > 3) - { gottaHitNote = !section.mustHitSection; - } var oldNote:Note; if (unspawnNotes.length > 0) @@ -1703,25 +1633,16 @@ class PlayState extends MusicBeatState sustainNote.mustPress = gottaHitNote; if (sustainNote.mustPress) - { sustainNote.x += FlxG.width / 2; // general offset - } } swagNote.mustPress = gottaHitNote; if (swagNote.mustPress) - { swagNote.x += FlxG.width / 2; // general offset - } - else {} } - daBeats += 1; } - // trace(unspawnNotes.length); - // playerCounter += 1; - unspawnNotes.sort(sortByShit); generatedMusic = true; @@ -1839,9 +1760,7 @@ class PlayState extends MusicBeatState babyArrow.ID = i; if (player == 1) - { playerStrums.add(babyArrow); - } babyArrow.animation.play('static'); babyArrow.x += 50; @@ -1878,9 +1797,7 @@ class PlayState extends MusicBeatState if (paused) { if (FlxG.sound.music != null && !startingSong) - { resyncVocals(); - } if (!startTimer.finished) startTimer.active = true; @@ -1888,13 +1805,9 @@ class PlayState extends MusicBeatState #if discord_rpc if (startTimer.finished) - { DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength - Conductor.songPosition); - } else - { DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC); - } #end } @@ -1907,13 +1820,9 @@ class PlayState extends MusicBeatState if (health > 0 && !paused && FlxG.autoPause) { if (Conductor.songPosition > 0.0) - { DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength - Conductor.songPosition); - } else - { DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC); - } } super.onFocus(); @@ -1922,9 +1831,7 @@ class PlayState extends MusicBeatState override public function onFocusLost():Void { if (health > 0 && !paused && FlxG.autoPause) - { DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC); - } super.onFocusLost(); } @@ -1959,9 +1866,6 @@ class PlayState extends MusicBeatState perfectMode = false; #end - if (FlxG.keys.justPressed.NINE) - iconP1.swapOldIcon(); - // do this BEFORE super.update() so songPosition is accurate if (startingSong) { @@ -1991,7 +1895,6 @@ class PlayState extends MusicBeatState // trace('MISSED FRAME'); } } - // Conductor.lastSongPos = FlxG.sound.music.time; } @@ -2055,6 +1958,9 @@ class PlayState extends MusicBeatState #end } + if (FlxG.keys.justPressed.NINE) + iconP1.swapOldIcon(); + // FlxG.watch.addQuick('VOL', vocals.amplitudeLeft); // FlxG.watch.addQuick('VOLRight', vocals.amplitudeRight); @@ -2520,6 +2426,7 @@ class PlayState extends MusicBeatState if (!practiceMode) songScore += score; + // ludum dare rating system /* if (combo > 60) daRating = 'sick'; else if (combo > 12) @@ -2677,9 +2584,7 @@ class PlayState extends MusicBeatState vocals.volume = 1; if (SONG.song.toLowerCase() == 'tutorial') - { tweenCamIn(); - } } if (cameraRightSide && camFollow.x != boyfriend.getMidpoint().x - 100) @@ -2692,18 +2597,13 @@ class PlayState extends MusicBeatState camFollow.x = boyfriend.getMidpoint().x - 300; case 'mall': camFollow.y = boyfriend.getMidpoint().y - 200; - case 'school': - camFollow.x = boyfriend.getMidpoint().x - 200; - camFollow.y = boyfriend.getMidpoint().y - 200; - case 'schoolEvil': + case 'school' | 'schoolEvil': camFollow.x = boyfriend.getMidpoint().x - 200; camFollow.y = boyfriend.getMidpoint().y - 200; } if (SONG.song.toLowerCase() == 'tutorial') - { FlxTween.tween(FlxG.camera, {zoom: 1}, (Conductor.stepCrochet * 4 / 1000), {ease: FlxEase.elasticInOut}); - } } } @@ -3103,9 +3003,7 @@ class PlayState extends MusicBeatState iconP2.updateHitbox(); if (curBeat % gfSpeed == 0) - { gf.dance(); - } if (curBeat % 2 == 0) { @@ -3136,6 +3034,7 @@ class PlayState extends MusicBeatState spr.dance(); }); + // boppin friends switch (curStage) { case 'school': From 69871d096c449df375c44d23c7a5605baf9e1b0f Mon Sep 17 00:00:00 2001 From: MtH Date: Thu, 22 Apr 2021 21:36:56 +0200 Subject: [PATCH 12/13] fix crash when going back to title --- source/MainMenuState.hx | 3 + source/TitleState.hx | 166 +++++++++++++++++++--------------------- 2 files changed, 80 insertions(+), 89 deletions(-) diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 492b0d4ba..1bb8747bc 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -260,7 +260,10 @@ class MainMenuState extends MusicBeatState menuItems.enabled = false; if (controls.BACK && menuItems.enabled && !menuItems.busy) + { + FlxG.sound.play(Paths.sound('cancelMenu')); FlxG.switchState(new TitleState()); + } super.update(elapsed); } diff --git a/source/TitleState.hx b/source/TitleState.hx index 2b547483b..95026a2f1 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -48,6 +48,7 @@ import sys.thread.Thread; class TitleState extends MusicBeatState { public static var initialized:Bool = false; + var startedIntro:Bool; var blackScreen:FlxSprite; var credGroup:FlxGroup; @@ -73,6 +74,8 @@ class TitleState extends MusicBeatState // FlxG.bitmap.clearCache(); #end + startedIntro = false; + FlxG.game.focusLostFramerate = 60; swagShader = new ColorSwap(); @@ -222,20 +225,11 @@ class TitleState extends MusicBeatState new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4)); FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1), {asset: diamond, width: 32, height: 32}, new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4)); + } - transIn = FlxTransitionableState.defaultTransIn; - transOut = FlxTransitionableState.defaultTransOut; - - // HAD TO MODIFY SOME BACKEND SHIT - // IF THIS PR IS HERE IF ITS ACCEPTED UR GOOD TO GO - // https://github.com/HaxeFlixel/flixel-addons/pull/348 - - // var music:FlxSound = new FlxSound(); - // music.loadStream(Paths.music('freakyMenu')); - // FlxG.sound.list.add(music); - // music.play(); + if (FlxG.sound.music == null || !FlxG.sound.music.playing) + { FlxG.sound.playMusic(Paths.music('freakyMenu'), 0); - FlxG.sound.music.fadeIn(4, 0, 0.7); } @@ -331,6 +325,7 @@ class TitleState extends MusicBeatState if (FlxG.sound.music != null) FlxG.sound.music.onComplete = function() FlxG.switchState(new VideoState()); + startedIntro = true; // credGroup.add(credTextShit); } @@ -353,8 +348,10 @@ class TitleState extends MusicBeatState override function update(elapsed:Float) { + #if debug if (FlxG.keys.justPressed.EIGHT) FlxG.switchState(new CutsceneAnimTestState()); + #end /* if (FlxG.keys.justPressed.R) @@ -372,9 +369,7 @@ class TitleState extends MusicBeatState // FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude); if (FlxG.keys.justPressed.F) - { FlxG.fullscreen = !FlxG.fullscreen; - } var pressedEnter:Bool = FlxG.keys.justPressed.ENTER; @@ -382,17 +377,10 @@ class TitleState extends MusicBeatState for (touch in FlxG.touches.list) { if (touch.justPressed) - { pressedEnter = true; - } } #end - if (FlxG.keys.justPressed.FIVE) - { - FlxG.switchState(new CutsceneAnimTestState()); - } - var gamepad:FlxGamepad = FlxG.gamepads.lastActive; if (gamepad != null) @@ -456,9 +444,7 @@ class TitleState extends MusicBeatState } if (pressedEnter && !skippedIntro && initialized) - { skipIntro(); - } /* #if web if (!initialized && controls.ACCEPT) @@ -476,16 +462,10 @@ class TitleState extends MusicBeatState // swagShader.hasOutline = !swagShader.hasOutline; if (controls.UI_LEFT) - { swagShader.update(-elapsed * 0.1); - // alphaShader.update(-elapsed * 0.1); - } if (controls.UI_RIGHT) - { swagShader.update(elapsed * 0.1); - // alphaShader.update(elapsed * 0.1); - } super.update(elapsed); } @@ -526,75 +506,83 @@ class TitleState extends MusicBeatState { super.beatHit(); - logoBl.animation.play('bump', true); + if (!startedIntro) + return ; - danceLeft = !danceLeft; - - if (danceLeft) - gfDance.animation.play('danceRight'); - else - gfDance.animation.play('danceLeft'); - - FlxG.log.add(curBeat); - // if the user is draggin the window some beats will - // be missed so this is just to compensate - if (curBeat > lastBeat) + if (skippedIntro) { - for (i in lastBeat...curBeat) + logoBl.animation.play('bump', true); + + danceLeft = !danceLeft; + + if (danceLeft) + gfDance.animation.play('danceRight'); + else + gfDance.animation.play('danceLeft'); + } + else + { + FlxG.log.add(curBeat); + // if the user is draggin the window some beats will + // be missed so this is just to compensate + if (curBeat > lastBeat) { - switch (i + 1) + for (i in lastBeat...curBeat) { - 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; + 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; } - lastBeat = curBeat; } var skippedIntro:Bool = false; From cd353af0c5b8121185ca793444ed04ce217f6a51 Mon Sep 17 00:00:00 2001 From: MtH Date: Fri, 23 Apr 2021 19:15:40 +0200 Subject: [PATCH 13/13] just pushin b4 i switch branch --- source/ui/OptionsState.hx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/ui/OptionsState.hx b/source/ui/OptionsState.hx index 14e772986..10ec025da 100644 --- a/source/ui/OptionsState.hx +++ b/source/ui/OptionsState.hx @@ -215,7 +215,7 @@ class OptionsMenu extends Page } /** - * True if this page has multiple options, ecluding the exit option. + * True if this page has multiple options, excluding the exit option. * If false, there's no reason to ever show this page. */ public function hasMultipleOptions():Bool @@ -267,11 +267,12 @@ class OptionsMenu extends Page function checkLoginStatus() { + // this shit don't work!! wtf!!!! var prevLoggedIn = items.has("logout"); if (prevLoggedIn && !NGio.isLoggedIn) - items.resetItem("login", "logout", selectLogout); - else if (!prevLoggedIn && NGio.isLoggedIn) items.resetItem("logout", "login", selectLogin); + else if (!prevLoggedIn && NGio.isLoggedIn) + items.resetItem("login", "logout", selectLogout); } #end }