made progress on analysis screen and fixing average beats per second
This commit is contained in:
@@ -16,7 +16,7 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
private MersenneTwister rand;
|
||||
private GamePlayMap map;
|
||||
private float avgBPS;
|
||||
|
||||
private float second;
|
||||
public RhythmMapAlgorithm(AudioAnalyzer analyzer) {
|
||||
bassPeaks = analyzer.getBassPeaks();
|
||||
UMPeaks = analyzer.getUMPeaks();
|
||||
@@ -24,6 +24,7 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
map = new GamePlayMap(analyzer.getAudioData());
|
||||
rand = new MersenneTwister(analyzer.getPUID());
|
||||
avgBPS = analyzer.getAvgBPS();
|
||||
second = analyzer.getsecondsPerFrame();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,13 +32,19 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
map.beginBuild();
|
||||
for (int index = 0; index < bassPeaks.size; index++) {
|
||||
if (bassPeaks.get(index) != 0 || UMPeaks.get(index) != 0) {
|
||||
if (overlappedPeaks.get(index) != 0) {
|
||||
if (overlappedPeaks.get(index+3) != 0) {
|
||||
//TODO basic void circle spawning
|
||||
float endRadius = rand.nextFloat()*Polyjet.GAME_AREA_WIDTH;
|
||||
|
||||
map.addToMap(Entities.VOID_CIRCLE,
|
||||
overlappedPeaks.get(index)*Polyjet.GAME_AREA_WIDTH,
|
||||
endRadius,
|
||||
rand.nextFloat()*Polyjet.GAME_AREA_WIDTH,
|
||||
rand.nextFloat()*Polyjet.GAME_AREA_HEIGHT);
|
||||
} else if (bassPeaks.get(index) != 0) {
|
||||
rand.nextFloat()*Polyjet.GAME_AREA_HEIGHT,
|
||||
avgBPS,
|
||||
3f*second
|
||||
);
|
||||
}
|
||||
if (bassPeaks.get(index) != 0) {
|
||||
map.addToMap(Entities.BAR,
|
||||
MathUtils.round(rand.nextFloat()*Polyjet.GAME_AREA_WIDTH),
|
||||
bassPeaks.get(index)*Polyjet.GAME_AREA_HEIGHT/avgBPS);
|
||||
|
||||
Reference in New Issue
Block a user