diff --git a/source/Character.hx b/source/Character.hx index ef8c3d96b..fcb1be91d 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -1,5 +1,6 @@ package; +import Section.SwagSection; import flixel.FlxG; import flixel.FlxSprite; import flixel.animation.FlxBaseAnimation; @@ -18,6 +19,8 @@ class Character extends FlxSprite public var holdTimer:Float = 0; + public var animationNotes:Array<Dynamic> = []; + public function new(x:Float, y:Float, ?character:String = "bf", ?isPlayer:Bool = false) { super(x, y); @@ -287,6 +290,8 @@ class Character extends FlxSprite loadOffsetFile(curCharacter); playAnim('shoot1'); + loadMappedAnims(); + case 'bf': var tex = Paths.getSparrowAtlas('characters/BOYFRIEND'); frames = tex; @@ -563,6 +568,23 @@ class Character extends FlxSprite } } + public function loadMappedAnims() + { + var swagshit = Song.loadFromJson('picospeaker', 'stress'); + + var notes = swagshit.notes; + + for (section in notes) + { + for (idk in section.sectionNotes) + { + animationNotes.push(idk); + } + } + + trace(animationNotes); + } + function quickAnimAdd(name:String, prefix:String) { animation.addByPrefix(name, prefix, 24, false); @@ -604,6 +626,25 @@ class Character extends FlxSprite case 'gf': if (animation.curAnim.name == 'hairFall' && animation.curAnim.finished) playAnim('danceRight'); + case "pico-speaker": + // for pico?? + if (animationNotes.length > 0) + { + if (Conductor.songPosition > animationNotes[0][0]) + { + trace('played shoot anim' + animationNotes[0][1]); + + var shootAnim:Int = 1; + + if (animationNotes[0][1] >= 2) + shootAnim = 3; + + shootAnim += FlxG.random.int(0, 1); + + playAnim('shoot' + shootAnim, true); + animationNotes.shift(); + } + } } super.update(elapsed); @@ -663,7 +704,8 @@ class Character extends FlxSprite playAnim('danceLeft'); } case 'pico-speaker': - playAnim('shoot' + FlxG.random.int(1, 4), true); + // lol weed + // playAnim('shoot' + FlxG.random.int(1, 4), true); case 'spooky': danced = !danced; diff --git a/source/PlayState.hx b/source/PlayState.hx index 86d2e87f1..6dbad2a19 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -710,7 +710,7 @@ class PlayState extends MusicBeatState // startCountdown(); - generateSong(SONG.song); + generateSong(); // add(strumLine); @@ -1084,7 +1084,7 @@ class PlayState extends MusicBeatState var debugNum:Int = 0; - private function generateSong(dataPath:String):Void + private function generateSong():Void { // FlxG.log.add(ChartParser.parse());