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 strumLineNotes:FlxTypedGroup<FlxSprite> = null;
|
||||||
public static var playerStrums:FlxTypedGroup<FlxSprite> = null;
|
public static var playerStrums:FlxTypedGroup<FlxSprite> = null;
|
||||||
|
public static var cpuStrums:FlxTypedGroup<FlxSprite> = null;
|
||||||
|
|
||||||
private var camZooming:Bool = false;
|
private var camZooming:Bool = false;
|
||||||
private var curSong:String = "";
|
private var curSong:String = "";
|
||||||
@ -854,6 +855,7 @@ class PlayState extends MusicBeatState
|
|||||||
add(strumLineNotes);
|
add(strumLineNotes);
|
||||||
|
|
||||||
playerStrums = new FlxTypedGroup<FlxSprite>();
|
playerStrums = new FlxTypedGroup<FlxSprite>();
|
||||||
|
cpuStrums = new FlxTypedGroup<FlxSprite>();
|
||||||
|
|
||||||
// startCountdown();
|
// startCountdown();
|
||||||
|
|
||||||
@ -1576,15 +1578,23 @@ class PlayState extends MusicBeatState
|
|||||||
|
|
||||||
babyArrow.ID = i;
|
babyArrow.ID = i;
|
||||||
|
|
||||||
if (player == 1)
|
switch (player)
|
||||||
{
|
{
|
||||||
playerStrums.add(babyArrow);
|
case 0:
|
||||||
|
cpuStrums.add(babyArrow);
|
||||||
|
case 1:
|
||||||
|
playerStrums.add(babyArrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
babyArrow.animation.play('static');
|
babyArrow.animation.play('static');
|
||||||
babyArrow.x += 50;
|
babyArrow.x += 50;
|
||||||
babyArrow.x += ((FlxG.width / 2) * player);
|
babyArrow.x += ((FlxG.width / 2) * player);
|
||||||
|
|
||||||
|
cpuStrums.forEach(function(spr:FlxSprite)
|
||||||
|
{
|
||||||
|
spr.centerOffsets(); //CPU arrows start out slightly off-center
|
||||||
|
});
|
||||||
|
|
||||||
strumLineNotes.add(babyArrow);
|
strumLineNotes.add(babyArrow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2278,6 +2288,22 @@ class PlayState extends MusicBeatState
|
|||||||
dad.playAnim('singLEFT' + altAnim, true);
|
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 windows
|
||||||
if (luaModchart != null)
|
if (luaModchart != null)
|
||||||
luaModchart.executeState('playerTwoSing', [Math.abs(daNote.noteData), Conductor.songPosition]);
|
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)
|
if (!inCutscene)
|
||||||
keyShit();
|
keyShit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user