tuning with other songs
This commit is contained in:
@@ -22,7 +22,8 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
|
||||
private float avgBass;
|
||||
private float avgUM;
|
||||
private float avgBPS;
|
||||
private float avgSPB;
|
||||
private float umMax, bassMax;
|
||||
|
||||
private float speedMod, healthMod;
|
||||
|
||||
@@ -37,12 +38,14 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
overlappedPeaks = analyzer.getOverlappedPeaks();
|
||||
map = new GamePlayMap(analyzer.getAudioData());
|
||||
rand = new MersenneTwister(analyzer.getPUID());
|
||||
avgBPS = analyzer.getAvgBPS();
|
||||
avgSPB = analyzer.getAvgSPB();
|
||||
windowPerSecond = 1/analyzer.getsecondsPerWindow();
|
||||
|
||||
this.speedMod = speedMod;
|
||||
this.healthMod = healthMod;
|
||||
|
||||
umMax = analyzer.getUMMaxValue();
|
||||
bassMax = analyzer.getBassMaxValue();
|
||||
avgBass = analyzer.getBassAvg();
|
||||
avgUM = analyzer.getUmAvg();
|
||||
}
|
||||
@@ -53,22 +56,22 @@ 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) {
|
||||
if ((index+warningTime < bassPeaks.size) && bassPeaks.get(index + warningTime) >= avgBass*3f/4f) {
|
||||
//TODO basic void circle spawning
|
||||
float endRadius = overlappedPeaks.get(index + warningTime)*Polyjet.GAME_AREA_HEIGHT/4;
|
||||
float endRadius = bassPeaks.get(index + warningTime)/bassMax*(Polyjet.GAME_AREA_HEIGHT/4f);
|
||||
|
||||
map.addToMap(Entities.VOID_CIRCLE,
|
||||
endRadius,
|
||||
rand.nextFloat()*Polyjet.GAME_AREA_WIDTH,
|
||||
rand.nextFloat()*Polyjet.GAME_AREA_HEIGHT,
|
||||
endRadius/avgBPS,
|
||||
warningTime
|
||||
endRadius/avgSPB,
|
||||
3f/speedMod
|
||||
);
|
||||
}
|
||||
if (bassPeaks.get(index) != 0) {
|
||||
map.addToMap(Entities.BAR,
|
||||
MathUtils.round(1.5f+rand.nextFloat()*(Polyjet.GAME_AREA_WIDTH-3)),
|
||||
(8f/avgBPS)*speedMod);
|
||||
(8f/avgSPB)*speedMod);
|
||||
} else {
|
||||
if (UMPeaks.get(index) != 0) {
|
||||
float xSpawnLocation = (rand.nextFloat()*(Polyjet.GAME_AREA_WIDTH-2))+1;
|
||||
@@ -76,7 +79,7 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
xSpawnLocation,
|
||||
Polyjet.GAME_AREA_HEIGHT-0.25f,
|
||||
180*rand.nextFloat()+90,
|
||||
speedMod*(1f/avgBPS));
|
||||
speedMod*(1f/avgSPB));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user