almost got good prototyping shit in

This commit is contained in:
Cameron Taylor
2020-10-13 18:44:07 -07:00
parent 96e618327f
commit fc5e73a87a
3 changed files with 35 additions and 3 deletions

View File

@ -57,6 +57,8 @@ class ChartingState extends MusicBeatState
var sections:Array<Section> = [];
var gridBG:FlxSprite;
var oldSongData:Song;
override function create()
{
gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * 8, GRID_SIZE * 16);
@ -66,6 +68,18 @@ class ChartingState extends MusicBeatState
addSection();
if (PlayState.SONG != null)
oldSongData = PlayState.SONG;
else
{
oldSongData = new Song(curSong, sections, Conductor.bpm, sections.length);
}
curSong = oldSongData.song;
sections = oldSongData.notes;
updateGrid();
FlxG.sound.playMusic('assets/music/' + curSong + '.mp3', 0.6);
FlxG.sound.music.pause();
FlxG.sound.music.onComplete = function()
@ -183,7 +197,7 @@ class ChartingState extends MusicBeatState
if (FlxG.keys.justPressed.ENTER)
{
PlayState.SONG = new Song(curSong, getNotes(), Conductor.bpm, sections.length);
PlayState.SONG = new Song(curSong, sections, Conductor.bpm, sections.length);
FlxG.sound.music.stop();
FlxG.switchState(new PlayState());
}
@ -308,6 +322,11 @@ class ChartingState extends MusicBeatState
private var daSpacing:Float = 0.3;
function loadLevel():Void
{
trace(oldSongData.notes);
}
function getNotes():Array<Dynamic>
{
var noteData:Array<Dynamic> = [];