wocky slush

debug shit, gf in animdebug, changesection
This commit is contained in:
MtH 2021-04-21 15:07:36 +02:00
parent a280301809
commit 0d076e186a
1 changed files with 32 additions and 2 deletions

View File

@ -77,7 +77,6 @@ class PlayState extends MusicBeatState
private var unspawnNotes:Array<Note> = [];
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;