BPM map, trim off useless song stuff, adjust MILF cam zoom
This commit is contained in:
@ -1,9 +1,19 @@
|
||||
package;
|
||||
|
||||
import Song.SwagSong;
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @author
|
||||
*/
|
||||
|
||||
typedef BPMChangeEvent =
|
||||
{
|
||||
var stepTime:Int;
|
||||
var songTime:Float;
|
||||
var bpm:Int;
|
||||
}
|
||||
|
||||
class Conductor
|
||||
{
|
||||
public static var bpm:Int = 100;
|
||||
@ -16,10 +26,39 @@ class Conductor
|
||||
public static var safeFrames:Int = 10;
|
||||
public static var safeZoneOffset:Float = (safeFrames / 60) * 1000; // is calculated in create(), is safeFrames in milliseconds
|
||||
|
||||
public static var bpmChangeMap:Array<BPMChangeEvent> = [];
|
||||
|
||||
public function new()
|
||||
{
|
||||
}
|
||||
|
||||
public static function mapBPMChanges(song:SwagSong)
|
||||
{
|
||||
bpmChangeMap = [];
|
||||
|
||||
var curBPM:Int = song.bpm;
|
||||
var totalSteps:Int = 0;
|
||||
var totalPos:Float = 0;
|
||||
for (i in 0...song.notes.length)
|
||||
{
|
||||
if(song.notes[i].changeBPM && song.notes[i].bpm != curBPM)
|
||||
{
|
||||
curBPM = song.notes[i].bpm;
|
||||
var event:BPMChangeEvent = {
|
||||
stepTime: totalSteps,
|
||||
songTime: totalPos,
|
||||
bpm: curBPM
|
||||
};
|
||||
bpmChangeMap.push(event);
|
||||
}
|
||||
|
||||
var deltaSteps:Int = song.notes[i].lengthInSteps;
|
||||
totalSteps += deltaSteps;
|
||||
totalPos += ((60 / curBPM) * 1000 / 4) * deltaSteps;
|
||||
}
|
||||
trace("new BPM map BUDDY " + bpmChangeMap);
|
||||
}
|
||||
|
||||
public static function changeBPM(newBpm:Int)
|
||||
{
|
||||
bpm = newBpm;
|
||||
|
Reference in New Issue
Block a user