diff --git a/source/PlayState.hx b/source/PlayState.hx index fdb8654..b2a5fc3 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -119,6 +119,7 @@ class PlayState extends MusicBeatState public static var strumLineNotes:FlxTypedGroup = null; public static var playerStrums:FlxTypedGroup = null; + public static var cpuStrums:FlxTypedGroup = null; private var camZooming:Bool = false; private var curSong:String = ""; @@ -854,6 +855,7 @@ class PlayState extends MusicBeatState add(strumLineNotes); playerStrums = new FlxTypedGroup(); + cpuStrums = new FlxTypedGroup(); // startCountdown(); @@ -1576,14 +1578,22 @@ class PlayState extends MusicBeatState 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.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); } @@ -2277,6 +2287,22 @@ class PlayState extends MusicBeatState case 0: 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) @@ -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();