song event trace prototype

This commit is contained in:
Cameron Taylor 2022-09-17 05:51:21 -04:00
parent f47e67e073
commit f70b581bf8
2 changed files with 18 additions and 3 deletions

View file

@ -45,6 +45,7 @@ class TitleState extends MusicBeatState
var video:Video;
var netStream:NetStream;
private var overlay:Sprite;
var songEventStuff:Map<Int, Array<SongEventInfo>>;
override public function create():Void
{
@ -55,8 +56,7 @@ class TitleState extends MusicBeatState
FlxG.sound.cache(Paths.music('freakyMenu'));
var jsonThing:String = Paths.file('data/songs/bopeebo/bopeebo-events.json');
var songstuffLol = NoteUtil.loadSongEvents(jsonThing);
trace(songstuffLol);
songEventStuff = NoteUtil.loadSongEvents(jsonThing);
// DEBUG BULLSHIT
@ -270,6 +270,8 @@ class TitleState extends MusicBeatState
override function update(elapsed:Float)
{
NoteUtil.checkSongEvents(songEventStuff, Conductor.songPosition);
#if HAS_PITCH
if (FlxG.keys.pressed.UP)
FlxG.sound.music.pitch += 0.5 * elapsed;

View file

@ -59,7 +59,20 @@ class NoteUtil
{
for (eventGrp in songData.keys())
{
trace(eventGrp);
if (time >= eventGrp)
{
for (events in songData[eventGrp])
{
if (!events.activated)
{
// TURN TO NICER SWITCH STATEMENT CHECKER OF EVENT TYPES!!
trace(events.value);
trace(eventGrp);
trace(Conductor.songPosition);
events.activated = true;
}
}
}
}
}
}