made progress on analysis screen and fixing average beats per second

This commit is contained in:
2017-07-10 00:29:50 -05:00
parent d815a3c053
commit cf0114bac3
8 changed files with 82 additions and 29 deletions

View File

@@ -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);