diff --git a/build.gradle b/build.gradle index 85f7832..abd30a9 100755 --- a/build.gradle +++ b/build.gradle @@ -41,7 +41,6 @@ project(":desktop") { compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" - compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" } } @@ -64,13 +63,6 @@ project(":android") { natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64" - compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" - natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi" - natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a" - natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a" - natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86" - natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64" - compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion" } } @@ -85,8 +77,6 @@ project(":core") { compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" - compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" - compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion" compile "org.apache.commons:commons-math3:3.2" diff --git a/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java b/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java index a507642..50a3d44 100755 --- a/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java +++ b/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java @@ -128,7 +128,7 @@ public class AudioAnalyzer { shrinkData(); containsData = true; - + Gdx.app.debug("Audio Analyzer", "USING SEED: " + PUID); sender.send(MiniEvents.SPECTRAL_FLUX_DONE); } } @@ -138,7 +138,6 @@ public class AudioAnalyzer { @Override public void run() { - Gdx.app.debug("Audio Analyzer", "USING SEED: " + PUID); //threshold calculation for (int i = 0; i < UMSpectralFlux.size && work; i++) { diff --git a/core/src/zero1hd/polyjet/entity/Entities.java b/core/src/zero1hd/polyjet/entity/Entities.java index ec7b0a1..6ae0576 100755 --- a/core/src/zero1hd/polyjet/entity/Entities.java +++ b/core/src/zero1hd/polyjet/entity/Entities.java @@ -1,7 +1,7 @@ package zero1hd.polyjet.entity; public enum Entities { - Bar_Beat, Void_Circle; + BAR_BEAT, VOID_CIRCLE, SHARDS; public float x; public float y; diff --git a/core/src/zero1hd/polyjet/entity/Entity.java b/core/src/zero1hd/polyjet/entity/Entity.java new file mode 100644 index 0000000..1660400 --- /dev/null +++ b/core/src/zero1hd/polyjet/entity/Entity.java @@ -0,0 +1,52 @@ +package zero1hd.polyjet.entity; + +import com.badlogic.gdx.math.Rectangle; +import com.badlogic.gdx.scenes.scene2d.Actor; + +public class Entity extends Actor { + private Rectangle box; + + public Entity() { + box = new Rectangle(); + } + + @Override + public void setHeight(float height) { + box.height = height; + super.setHeight(height); + } + + @Override + public void setWidth(float width) { + box.width = width; + super.setWidth(width); + } + + @Override + public void setSize(float width, float height) { + box.setSize(width, height); + super.setSize(width, height); + } + + @Override + public void setX(float x) { + box.setX(x); + super.setX(x); + } + + @Override + public void setY(float y) { + box.setY(y); + super.setY(y); + } + + @Override + public void setPosition(float x, float y) { + box.setPosition(x, y); + super.setPosition(x, y); + } + + public Rectangle getBox() { + return box; + } +} diff --git a/core/src/zero1hd/polyjet/entity/PolyJetEntity.java b/core/src/zero1hd/polyjet/entity/PolyJetEntity.java index 1fcc5d4..4387a50 100755 --- a/core/src/zero1hd/polyjet/entity/PolyJetEntity.java +++ b/core/src/zero1hd/polyjet/entity/PolyJetEntity.java @@ -8,7 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.actions.Actions; import zero1hd.polyjet.Polyjet; -public class PolyJetEntity extends Actor { +public class PolyJetEntity extends Entity { private ParticleEffect thrust; private Texture polyjet; @@ -16,8 +16,8 @@ public class PolyJetEntity extends Actor { public boolean moveLeft, moveRight, moveUp, moveDown, teleporting; - private int rate; - public PolyJetEntity(Polyjet core, int rate, String jet) { + private float rate; + public PolyJetEntity(Polyjet core, float rate, String jet) { this.rate = rate; setSize(1.5f, 1.5f); @@ -63,6 +63,5 @@ public class PolyJetEntity extends Actor { thrust.draw(batch); batch.draw(polyjet, getX(), getY(), getWidth(), getHeight()); super.draw(batch, parentAlpha); - } } diff --git a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java index 61c6f5a..558882a 100755 --- a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java +++ b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java @@ -1,8 +1,5 @@ package zero1hd.polyjet.ui.stages; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Pixmap; -import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.utils.viewport.FitViewport; @@ -14,10 +11,6 @@ import zero1hd.polyjet.entity.PolyJetEntity; public class GamePlayArea extends Stage { public PolyJetEntity polyJet; - float timeCounter; - - //Required to know when to spawn entities on screen. - int audioIndex; private float health = 50; private float maxHealth = 100; @@ -28,20 +21,7 @@ public class GamePlayArea extends Stage { public GamePlayArea(Polyjet core) { super(new FitViewport(Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT)); - Pixmap basicLaser = new Pixmap(2, 32, Format.RGBA8888); - basicLaser.setColor(0f, 0.4f, 1f, 1f); - basicLaser.fill(); - - basicLaserTexture = new Texture(basicLaser); - basicLaser.dispose(); - - getCamera().far = 32f; - getCamera().near = 0f; - - Gdx.app.debug("Camera position (x,y,z)", getCamera().position.x + " " + getCamera().position.y + " " + getCamera().position.z); - getCamera().update(); - - polyJet = new PolyJetEntity(core, 54, "standard"); + polyJet = new PolyJetEntity(core, 48f, "standard"); addActor(polyJet); } @@ -51,8 +31,6 @@ public class GamePlayArea extends Stage { } @Override public void act(float delta) { - timeCounter+=delta; - health -= 2*delta; if (health <= 0) { @@ -81,9 +59,6 @@ public class GamePlayArea extends Stage { super.act(delta); } - public void setAudioIndex(int audioIndex) { - this.audioIndex = audioIndex; - } public void addScore (int score) { this.score += score; health += score; diff --git a/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java b/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java index 8fcc185..fe15b53 100755 --- a/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java +++ b/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java @@ -41,13 +41,12 @@ public class BeatViewer extends Window { final Image bassBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) { @Override public void act(float delta) { - if (music != null && data.getBassPeaks().get(songIndex) != 0) { - clearActions(); - try { + try { + if (music != null && data.getBassPeaks().get(songIndex) != 0) { + clearActions(); addAction(Actions.sequence(Actions.sizeTo(getWidth(), (data.getBassPeaks().get(songIndex)/data.getBassMaxValue())*bgBassBar.getHeight()), Actions.sizeTo(getWidth(), 0, 0.3f))); - } catch (IndexOutOfBoundsException e) { - } + } catch (IndexOutOfBoundsException e) { } super.act(delta); } @@ -64,13 +63,13 @@ public class BeatViewer extends Window { Image UMBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) { @Override public void act(float delta) { - if (music != null && data.getUMPeaks().get(songIndex) != 0) { - clearActions(); - try { + try { + if (music != null && data.getUMPeaks().get(songIndex) != 0) { + clearActions(); addAction(Actions.sequence(Actions.sizeTo(getWidth(), (data.getUMPeaks().get(songIndex)/data.getUMMaxValue())*bgUMBar.getHeight()), Actions.sizeTo(getWidth(), 0f, 0.3f))); - } catch (IndexOutOfBoundsException e) { - } + } catch (IndexOutOfBoundsException e) { + } super.act(delta); } @@ -86,9 +85,13 @@ public class BeatViewer extends Window { Image bassIndicator = new Image(lightOn) { @Override public void act(float delta) { - if (music != null && data.getBassPeaks().get(songIndex) != 0) { - clearActions(); - addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f))); + try { + if (music != null && data.getBassPeaks().get(songIndex) != 0) { + clearActions(); + addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f))); + } + } catch (IndexOutOfBoundsException e) { + // TODO: handle exception } super.act(delta); } @@ -101,9 +104,13 @@ public class BeatViewer extends Window { Image UMIndicator = new Image(lightOn) { @Override public void act(float delta) { - if (music != null && data.getUMPeaks().get(songIndex) != 0) { - clearActions(); - addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f))); + try { + if (music != null && data.getUMPeaks().get(songIndex) != 0) { + clearActions(); + addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f))); + } + } catch (IndexOutOfBoundsException e) { + } super.act(delta); }