progress on debug screen and minor error resolved with map gen
This commit is contained in:
@@ -8,8 +8,12 @@ import com.badlogic.gdx.utils.FloatArray;
|
||||
import zero1hd.polyjet.Polyjet;
|
||||
import zero1hd.polyjet.audio.AudioAnalyzer;
|
||||
import zero1hd.polyjet.entity.Entities;
|
||||
import zero1hd.polyjet.util.MiniEvents;
|
||||
import zero1hd.polyjet.util.MiniSender;
|
||||
|
||||
public class RhythmMapAlgorithm implements Runnable {
|
||||
private MiniSender sender;
|
||||
|
||||
private FloatArray bassPeaks;
|
||||
private FloatArray UMPeaks;
|
||||
private FloatArray overlappedPeaks;
|
||||
@@ -23,6 +27,8 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
|
||||
private volatile int progress;
|
||||
public RhythmMapAlgorithm(AudioAnalyzer analyzer, float speedMod, float healthMod) {
|
||||
sender = new MiniSender();
|
||||
|
||||
bassPeaks = analyzer.getBassPeaks();
|
||||
UMPeaks = analyzer.getUMPeaks();
|
||||
overlappedPeaks = analyzer.getOverlappedPeaks();
|
||||
@@ -41,7 +47,7 @@ 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 (overlappedPeaks.get(index + warningTime) != 0) {
|
||||
if ((index+warningTime <= bassPeaks.size) && overlappedPeaks.get(index + warningTime) != 0) {
|
||||
//TODO basic void circle spawning
|
||||
float endRadius = overlappedPeaks.get(index+3)*Polyjet.GAME_AREA_WIDTH;
|
||||
|
||||
@@ -73,6 +79,8 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
}
|
||||
|
||||
progress = (int) (100f*index/bassPeaks.size);
|
||||
|
||||
sender.send(MiniEvents.MAPGEN_ITERATED);
|
||||
}
|
||||
map.endBuild();
|
||||
}
|
||||
@@ -84,4 +92,8 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
public synchronized int getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public MiniSender getSender() {
|
||||
return sender;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user