diff --git a/assets/data/scripts/week6-pause.hx b/assets/data/scripts/week6-pause.hx index 2884cd34..a150a69e 100644 --- a/assets/data/scripts/week6-pause.hx +++ b/assets/data/scripts/week6-pause.hx @@ -29,13 +29,13 @@ function create(event) { bg = new FlxSprite(44 * 6, 14 * 6).loadGraphic(Paths.image('stages/school/pause/bg')); bg.scale.set(6, 6); bg.updateHitbox(); - bg.scale.y = 5; + bg.scale.y = 4; bg.cameras = [pauseCam]; add(bg); - text = new FlxText(0, 22 * 6, 0, "Pause", 8, false); - confText(text); - add(text); + songText = new FlxText(0, 22 * 6, 0, "Pause", 8, false); + confText(songText); + add(songText); var i = 2; for(e in menuItems) { @@ -73,11 +73,20 @@ function destroy() { FlxG.cameras.remove(pauseCam); } +var canDoShit = true; +var time:Float = 0; function update(elapsed) { pixelScript.call("updatePost", [elapsed]); pauseCam.alpha = lerp(pauseCam.alpha, 1, 0.25); + time += elapsed; + var curText = texts[curSelected]; + hand.setPosition(curText.x - hand.width - 18 + (Math.sin(time * Math.PI * 2) * 12), curText.y + (text.height - hand.height) - 6); + hand.x -= hand.x % 6; + hand.y -= hand.y % 6; + + if (!canDoShit) return; var oldSec = curSelected; if (controls.DOWN_P) changeSelection(1, false); @@ -88,14 +97,20 @@ function update(elapsed) { FlxG.sound.play(Paths.sound('pixel/pixelText')); } - var curText = texts[curSelected]; - hand.setPosition(curText.x - hand.width - 12, curText.y + (text.height - hand.height) - 6); - hand.x -= hand.x % 6; - hand.y -= hand.y % 6; if (controls.ACCEPT) { FlxG.sound.play(Paths.sound('pixel/clickText')); - selectOption(); + var option = menuItems[curSelected] + if (option == "Resume" || option == "Exit to menu") { + canDoShit = false; + for(t in texts) t.visible = false; + songText.visible = false; + FlxTween.tween(bg, {"scale.y": 0}, 0.125, {ease: FlxEase.cubeOut, onComplete: function() { + selectOption(); + }}); + } else { + selectOption(); + } } } diff --git a/buildnumber.txt b/buildnumber.txt index 09486914..646782c3 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1155 \ No newline at end of file +1157 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 1d005218..78673ea6 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -83,6 +83,7 @@ class PlayState extends MusicBeatState @:dox(hide) private function set_downscroll(v:Bool) {return camHUD.downscroll = v;} @:dox(hide) private function get_downscroll():Bool {return camHUD.downscroll;} + public var inst:FlxSound; public var vocals:FlxSound; public var dad:Character; @@ -412,8 +413,10 @@ class PlayState extends MusicBeatState previousFrameTime = FlxG.game.ticks; lastReportedPlayheadPosition = 0; - if (!paused) - FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false); + if (!paused) { + FlxG.sound.music = inst; + FlxG.sound.music.play(); + } FlxG.sound.music.onComplete = endSong; vocals.play(); @@ -440,6 +443,7 @@ class PlayState extends MusicBeatState curSong = songData.song; + inst = FlxG.sound.load(Paths.inst(PlayState.SONG.song)); vocals = new FlxSound(); if (SONG.needsVoices) vocals.loadEmbedded(Paths.voices(PlayState.SONG.song));