changed way void circle spawns

This commit is contained in:
Harrison Deng 2017-07-13 01:00:10 -05:00
parent 05cf360e71
commit c3e72ef86b

View File

@ -19,6 +19,9 @@ public class RhythmMapAlgorithm implements Runnable {
private FloatArray overlappedPeaks; private FloatArray overlappedPeaks;
private MersenneTwister rand; private MersenneTwister rand;
private GamePlayMap map; private GamePlayMap map;
private float avgBass;
private float avgUM;
private float avgBPS; private float avgBPS;
private float speedMod, healthMod; private float speedMod, healthMod;
@ -39,6 +42,9 @@ public class RhythmMapAlgorithm implements Runnable {
this.speedMod = speedMod; this.speedMod = speedMod;
this.healthMod = healthMod; this.healthMod = healthMod;
avgBass = analyzer.getBassAvg();
avgUM = analyzer.getUmAvg();
} }
@Override @Override
@ -47,9 +53,9 @@ public class RhythmMapAlgorithm implements Runnable {
for (int index = 0; index < bassPeaks.size; index++) { for (int index = 0; index < bassPeaks.size; index++) {
if (bassPeaks.get(index) != 0 || UMPeaks.get(index) != 0) { if (bassPeaks.get(index) != 0 || UMPeaks.get(index) != 0) {
int warningTime = (int) ((3/speedMod)*windowPerSecond); int warningTime = (int) ((3/speedMod)*windowPerSecond);
if ((index+warningTime <= bassPeaks.size) && overlappedPeaks.get(index + warningTime) != 0) { if ((index+warningTime <= bassPeaks.size) && bassPeaks.get(index + warningTime) >= avgBass) {
//TODO basic void circle spawning //TODO basic void circle spawning
float endRadius = overlappedPeaks.get(index+3)*Polyjet.GAME_AREA_WIDTH; float endRadius = overlappedPeaks.get(index + warningTime)*Polyjet.GAME_AREA_WIDTH;
map.addToMap(Entities.VOID_CIRCLE, map.addToMap(Entities.VOID_CIRCLE,
endRadius, endRadius,