diff --git a/android/assets/uiskin.atlas b/android/assets/uiskin.atlas index 0fab7e0..183734c 100755 --- a/android/assets/uiskin.atlas +++ b/android/assets/uiskin.atlas @@ -235,7 +235,7 @@ pause-down orig: 44, 44 offset: 0, 0 index: -1 -bar-empty +bar-fill rotate: false xy: 105, 13 size: 13, 3 @@ -243,7 +243,7 @@ bar-empty orig: 13, 3 offset: 0, 0 index: -1 -bar-fill +bar-empty rotate: false xy: 119, 13 size: 13, 3 diff --git a/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java b/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java index 91ce920..a1fb3db 100755 --- a/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java +++ b/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java @@ -65,16 +65,16 @@ public class AudioAnalyzer { int totalTasks = audioData.getSampleCount()/audioData.getReadWindowSize(); bassThresholdMultiplier = 1.5f; - umThresholdMultiplier = 1.5f; + umThresholdMultiplier = 1.4f; bassBinBegin = 1; - bassBinEnd = 14; + bassBinEnd = 13; - UMBinBegin = 15; - UMBinEnd = 512; + UMBinBegin = 14; + UMBinEnd = 513; bassThresholdCalcRange = thresholdRangeCalc(0.28f); - UMThresholdCalcRange = thresholdRangeCalc(0.3f); + UMThresholdCalcRange = thresholdRangeCalc(0.4f); Gdx.app.debug("Read freq", String.valueOf(audioData.getFormat().getSampleRate())); Gdx.app.debug("Using following bin ranges", "\nBass freq begin: " + bassBinBegin + "\nBass freq end: " + bassBinEnd + "\nMain freq begin: " + UMBinBegin + "\nMain freq end: " + UMBinEnd); diff --git a/core/src/zero1hd/polyjet/audio/map/GamePlayMap.java b/core/src/zero1hd/polyjet/audio/map/GamePlayMap.java index 4c7e1e8..34a6c36 100755 --- a/core/src/zero1hd/polyjet/audio/map/GamePlayMap.java +++ b/core/src/zero1hd/polyjet/audio/map/GamePlayMap.java @@ -86,4 +86,7 @@ public class GamePlayMap { } } + public int getIndex() { + return index; + } } diff --git a/core/src/zero1hd/polyjet/audio/map/RhythmMapAlgorithm.java b/core/src/zero1hd/polyjet/audio/map/RhythmMapAlgorithm.java index 033646e..f8e0dab 100755 --- a/core/src/zero1hd/polyjet/audio/map/RhythmMapAlgorithm.java +++ b/core/src/zero1hd/polyjet/audio/map/RhythmMapAlgorithm.java @@ -61,10 +61,10 @@ public class RhythmMapAlgorithm implements Runnable { if (bassPeaks.get(index) != 0 || UMPeaks.get(index) != 0) { if (bassPeaks.get(index) != 0) { //If there is a value of some sorts that is not zero, we generate some beat for the map - if (bassPeaks.get(index) >= avgBass) { + if (index > 1.5*windowPerSecond && bassPeaks.get(index) >= avgBass) { //If bass peak is greater than the bass peak average, then: - int indexMoved = map.setIndex((int) (windowPerSecond*1.5f)); - float waitTime = indexMoved/windowPerSecond; + int normalIndexPos = map.setIndex((int) (map.getIndex() - windowPerSecond*1.5f)); + float waitTime = 1.5f; float endRadius = (bassPeaks.get(index)/bassMax)*(Main.GAME_AREA_HEIGHT/4f); esi = map.addEntity(EntityIndex.VOID_CIRCLE); @@ -74,7 +74,7 @@ public class RhythmMapAlgorithm implements Runnable { esi.parameters.put("x", rand.nextFloat()*Main.GAME_AREA_WIDTH); esi.parameters.put("y", rand.nextFloat()*Main.GAME_AREA_HEIGHT); - map.setIndex(indexMoved); + map.setIndex(normalIndexPos); } } @@ -93,7 +93,7 @@ public class RhythmMapAlgorithm implements Runnable { esi = map.addEntity(EntityIndex.PELLET); esi.parameters.put("x", xSpawnLocation); esi.parameters.put("y", Main.GAME_AREA_HEIGHT-0.25f); - esi.parameters.put("angle", 140*rand.nextFloat()+110f); + esi.parameters.put("angle", 140*rand.nextFloat()+200f); esi.parameters.put("speed", (Main.GAME_AREA_HEIGHT/4f)/avgSPB); } diff --git a/core/src/zero1hd/polyjet/entity/CollisionDetector.java b/core/src/zero1hd/polyjet/entity/CollisionDetector.java index 82b976e..a291b2e 100755 --- a/core/src/zero1hd/polyjet/entity/CollisionDetector.java +++ b/core/src/zero1hd/polyjet/entity/CollisionDetector.java @@ -37,26 +37,29 @@ public class CollisionDetector { if ((enemies.size != 0) && (allies.size != 0)) { for (int f = 0; f < enemies.size; f++) { Entity enemy = enemies.get(f); - for (int s = 0; s < allies.size; s++) { - Entity ally = allies.get(s); - - if (enemy.getHitZone().overlaps(ally.getHitZone())) { - Gdx.app.debug("Collision Detector", "Collision between entities: " + enemy.getEntityType() + " and " + ally.getEntityType()); - - //Play FX; - if (ally.playCollideSFX() && enemy.playCollideSFX()) { - explosionSFX.play(prefs.getFloat("fx vol"), 1f, (enemy.getX()/Main.GAME_AREA_WIDTH)-0.55f); + if (enemy.getHitZone() != null) { + for (int s = 0; s < allies.size; s++) { + Entity ally = allies.get(s); + if (ally.getHitZone() != null) { + if (enemy.getHitZone().overlaps(ally.getHitZone())) { + Gdx.app.debug("Collision Detector", "Collision between entities: " + enemy.getEntityType() + " and " + ally.getEntityType()); + + //Play FX; + if (ally.playCollideSFX() && enemy.playCollideSFX()) { + explosionSFX.play(prefs.getFloat("fx vol"), 1f, (enemy.getX()/Main.GAME_AREA_WIDTH)-0.55f); + } + if (ally.playCollidePFX() && enemy.playCollidePFX()) { + PooledEffect currentPFX; + currentPFX = explosionEffectPool.obtain(); + currentPFX.setPosition(enemy.getX() + enemy.getWidth()/2f, enemy.getY() + enemy.getHeight()/2f); + effects.add(currentPFX); + } + + enemy.collided(ally); + ally.collided(enemy); + break; + } } - if (ally.playCollidePFX() && enemy.playCollidePFX()) { - PooledEffect currentPFX; - currentPFX = explosionEffectPool.obtain(); - currentPFX.setPosition(enemy.getX() + enemy.getWidth()/2f, enemy.getY() + enemy.getHeight()/2f); - effects.add(currentPFX); - } - - enemy.collided(ally); - ally.collided(enemy); - break; } } } diff --git a/core/src/zero1hd/polyjet/entity/enemies/Pellet.java b/core/src/zero1hd/polyjet/entity/enemies/Pellet.java index 9747553..86cd67a 100755 --- a/core/src/zero1hd/polyjet/entity/enemies/Pellet.java +++ b/core/src/zero1hd/polyjet/entity/enemies/Pellet.java @@ -16,6 +16,7 @@ public class Pellet extends Entity implements Poolable { @Override public void preInit() { sprite = new Sprite(assets.get("pellet.png", Texture.class)); + enemy = true; setSize(0.5f, 0.5f); super.preInit(); } diff --git a/core/src/zero1hd/polyjet/ui/builders/HealthBar.java b/core/src/zero1hd/polyjet/ui/builders/HealthBar.java index 821abff..8d218a9 100755 --- a/core/src/zero1hd/polyjet/ui/builders/HealthBar.java +++ b/core/src/zero1hd/polyjet/ui/builders/HealthBar.java @@ -20,7 +20,6 @@ public class HealthBar extends WidgetGroup { addActor(empty); - empty.toFront(); this.maxHealth = maxHealth; } diff --git a/core/src/zero1hd/polyjet/ui/stages/CreativeHUD.java b/core/src/zero1hd/polyjet/ui/stages/CreativeHUD.java index 0bbc983..16b6b88 100755 --- a/core/src/zero1hd/polyjet/ui/stages/CreativeHUD.java +++ b/core/src/zero1hd/polyjet/ui/stages/CreativeHUD.java @@ -217,8 +217,8 @@ public class CreativeHUD extends Stage implements MiniListener { @Override public void dispose() { - if (musicSelector.getSelectedMusic() != null) { - musicSelector.getSelectedMusic().dispose(); + if (analyzer != null) { + analyzer.audioData.dispose(); } super.dispose(); }