CPU Strum Lights
This commit is contained in:
parent
ca0d909e05
commit
84941b0d73
@ -119,6 +119,7 @@ class PlayState extends MusicBeatState
|
||||
|
||||
public static var strumLineNotes:FlxTypedGroup<FlxSprite> = null;
|
||||
public static var playerStrums:FlxTypedGroup<FlxSprite> = null;
|
||||
public static var cpuStrums:FlxTypedGroup<FlxSprite> = null;
|
||||
|
||||
private var camZooming:Bool = false;
|
||||
private var curSong:String = "";
|
||||
@ -854,6 +855,7 @@ class PlayState extends MusicBeatState
|
||||
add(strumLineNotes);
|
||||
|
||||
playerStrums = new FlxTypedGroup<FlxSprite>();
|
||||
cpuStrums = new FlxTypedGroup<FlxSprite>();
|
||||
|
||||
// startCountdown();
|
||||
|
||||
@ -1576,8 +1578,11 @@ class PlayState extends MusicBeatState
|
||||
|
||||
babyArrow.ID = i;
|
||||
|
||||
if (player == 1)
|
||||
switch (player)
|
||||
{
|
||||
case 0:
|
||||
cpuStrums.add(babyArrow);
|
||||
case 1:
|
||||
playerStrums.add(babyArrow);
|
||||
}
|
||||
|
||||
@ -1585,6 +1590,11 @@ class PlayState extends MusicBeatState
|
||||
babyArrow.x += 50;
|
||||
babyArrow.x += ((FlxG.width / 2) * player);
|
||||
|
||||
cpuStrums.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
spr.centerOffsets(); //CPU arrows start out slightly off-center
|
||||
});
|
||||
|
||||
strumLineNotes.add(babyArrow);
|
||||
}
|
||||
}
|
||||
@ -2278,6 +2288,22 @@ class PlayState extends MusicBeatState
|
||||
dad.playAnim('singLEFT' + altAnim, true);
|
||||
}
|
||||
|
||||
cpuStrums.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
if (Math.abs(daNote.noteData) == spr.ID)
|
||||
{
|
||||
spr.animation.play('confirm', true);
|
||||
}
|
||||
if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school'))
|
||||
{
|
||||
spr.centerOffsets();
|
||||
spr.offset.x -= 13;
|
||||
spr.offset.y -= 13;
|
||||
}
|
||||
else
|
||||
spr.centerOffsets();
|
||||
});
|
||||
|
||||
#if windows
|
||||
if (luaModchart != null)
|
||||
luaModchart.executeState('playerTwoSing', [Math.abs(daNote.noteData), Conductor.songPosition]);
|
||||
@ -2348,6 +2374,14 @@ class PlayState extends MusicBeatState
|
||||
});
|
||||
}
|
||||
|
||||
cpuStrums.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
if (spr.animation.finished)
|
||||
{
|
||||
spr.animation.play('static');
|
||||
spr.centerOffsets();
|
||||
}
|
||||
});
|
||||
|
||||
if (!inCutscene)
|
||||
keyShit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user