improved debugging and more adjustments
This commit is contained in:
@@ -221,7 +221,6 @@ public class AudioAnalyzer {
|
||||
if (bassPeaks.get(i) == 0) {
|
||||
avgSPB ++;
|
||||
} else {
|
||||
bassBeats ++;
|
||||
lastID = i;
|
||||
}
|
||||
} else if (bassPeaks.get(i) != 0) {
|
||||
@@ -230,6 +229,8 @@ public class AudioAnalyzer {
|
||||
|
||||
if (bassPeaks.get(i) != 0) {
|
||||
bassAvg += bassPeaks.get(i);
|
||||
bassBeats++;
|
||||
|
||||
}
|
||||
if (umPeaks.get(i) != 0) {
|
||||
umAvg += umPeaks.get(i);
|
||||
@@ -239,14 +240,15 @@ public class AudioAnalyzer {
|
||||
}
|
||||
|
||||
//then we minus one from the beats so it actually works out
|
||||
avgSPB -= umPrunned.size-lastID;
|
||||
avgSPB -= bassPrunned.size-lastID;
|
||||
avgSPB *= secondsPerWindow;
|
||||
avgSPB /= bassBeats;
|
||||
Gdx.app.debug("Audio Analyzer", "Avg BPS: " + avgSPB);
|
||||
Gdx.app.debug("Audio Analyzer", "Avg SPB: " + avgSPB);
|
||||
|
||||
bassAvg /= bassBeats;
|
||||
umBeats /= umBeats;
|
||||
|
||||
umAvg /= umBeats;
|
||||
Gdx.app.debug("Audio Analyzer", "Avg bass: " + bassAvg);
|
||||
Gdx.app.debug("Audio Analyzer", "Avg UM: " + umAvg);
|
||||
|
||||
if (work) {
|
||||
Gdx.app.debug("Audio Analyzer", "overlapped beats checked.");
|
||||
|
@@ -45,9 +45,10 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
this.healthMod = healthMod;
|
||||
|
||||
umMax = analyzer.getUMMaxValue();
|
||||
avgUM = analyzer.getUmAvg();
|
||||
|
||||
bassMax = analyzer.getBassMaxValue();
|
||||
avgBass = analyzer.getBassAvg();
|
||||
avgUM = analyzer.getUmAvg();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,15 +57,15 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
for (int index = 0; index < bassPeaks.size; index++) {
|
||||
if (bassPeaks.get(index) != 0 || UMPeaks.get(index) != 0) {
|
||||
int warningTime = (int) ((3/speedMod)*windowPerSecond);
|
||||
if ((index+warningTime < bassPeaks.size) && bassPeaks.get(index + warningTime) >= avgBass*3f/4f) {
|
||||
if ((index+warningTime < bassPeaks.size) && bassPeaks.get(index + warningTime) >= avgBass) {
|
||||
//TODO basic void circle spawning
|
||||
float endRadius = bassPeaks.get(index + warningTime)/bassMax*(Polyjet.GAME_AREA_HEIGHT/4f);
|
||||
float endRadius = (bassPeaks.get(index + warningTime)/bassMax)*(Polyjet.GAME_AREA_HEIGHT/2f);
|
||||
|
||||
map.addToMap(Entities.VOID_CIRCLE,
|
||||
endRadius,
|
||||
rand.nextFloat()*Polyjet.GAME_AREA_WIDTH,
|
||||
rand.nextFloat()*Polyjet.GAME_AREA_HEIGHT,
|
||||
endRadius/avgSPB,
|
||||
endRadius/(avgSPB*0.5f),
|
||||
3f/speedMod
|
||||
);
|
||||
}
|
||||
@@ -78,8 +79,8 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
map.addToMap(Entities.PELLET,
|
||||
xSpawnLocation,
|
||||
Polyjet.GAME_AREA_HEIGHT-0.25f,
|
||||
180*rand.nextFloat()+90,
|
||||
speedMod*(1f/avgSPB));
|
||||
140*rand.nextFloat()+110f,
|
||||
(Polyjet.GAME_AREA_HEIGHT/4f)/avgSPB);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user