wizard engine??

This commit is contained in:
Yoshman29
2022-11-05 21:04:02 +01:00
parent bb6221525a
commit bfd3043a1f
3 changed files with 31 additions and 12 deletions
+24 -9
View File
@@ -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();
}
}
}
+1 -1
View File
@@ -1 +1 @@
1155
1157
+6 -2
View File
@@ -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));