diff --git a/android/assets/1280x720/PolyjetTitle.png b/android/assets/1280x720/PolyjetTitle.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x720/Tech-Circle1.png b/android/assets/1280x720/Tech-Circle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x720/cybercircle1.png b/android/assets/1280x720/cybercircle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x720/cybercircle3B.png b/android/assets/1280x720/cybercircle3B.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x720/laser.png b/android/assets/1280x720/laser.png new file mode 100644 index 0000000..195d4d5 Binary files /dev/null and b/android/assets/1280x720/laser.png differ diff --git a/android/assets/1280x720/polyjet-standard.png b/android/assets/1280x720/polyjet-standard.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x720/splashlogo.png b/android/assets/1280x720/splashlogo.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x720/square.png b/android/assets/1280x720/square.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x800/PolyjetTitle.png b/android/assets/1280x800/PolyjetTitle.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x800/Tech-Circle1.png b/android/assets/1280x800/Tech-Circle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x800/cybercircle1.png b/android/assets/1280x800/cybercircle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x800/cybercircle3B.png b/android/assets/1280x800/cybercircle3B.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x800/laser.png b/android/assets/1280x800/laser.png new file mode 100644 index 0000000..df87a8a Binary files /dev/null and b/android/assets/1280x800/laser.png differ diff --git a/android/assets/1280x800/polyjet-standard.png b/android/assets/1280x800/polyjet-standard.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x800/splashlogo.png b/android/assets/1280x800/splashlogo.png old mode 100755 new mode 100644 diff --git a/android/assets/1280x800/square.png b/android/assets/1280x800/square.png old mode 100755 new mode 100644 diff --git a/android/assets/1366x768/PolyjetTitle.png b/android/assets/1366x768/PolyjetTitle.png old mode 100755 new mode 100644 diff --git a/android/assets/1366x768/Tech-Circle1.png b/android/assets/1366x768/Tech-Circle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1366x768/cybercircle1.png b/android/assets/1366x768/cybercircle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1366x768/cybercircle3B.png b/android/assets/1366x768/cybercircle3B.png old mode 100755 new mode 100644 diff --git a/android/assets/1366x768/laser.png b/android/assets/1366x768/laser.png new file mode 100644 index 0000000..fa8e37f Binary files /dev/null and b/android/assets/1366x768/laser.png differ diff --git a/android/assets/1366x768/polyjet-standard.png b/android/assets/1366x768/polyjet-standard.png old mode 100755 new mode 100644 diff --git a/android/assets/1366x768/splashlogo.png b/android/assets/1366x768/splashlogo.png old mode 100755 new mode 100644 diff --git a/android/assets/1366x768/square.png b/android/assets/1366x768/square.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1080/PolyjetTitle.png b/android/assets/1920x1080/PolyjetTitle.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1080/Tech-Circle1.png b/android/assets/1920x1080/Tech-Circle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1080/cybercircle1.png b/android/assets/1920x1080/cybercircle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1080/cybercircle3B.png b/android/assets/1920x1080/cybercircle3B.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1080/laser.png b/android/assets/1920x1080/laser.png new file mode 100644 index 0000000..785cbc6 Binary files /dev/null and b/android/assets/1920x1080/laser.png differ diff --git a/android/assets/1920x1080/polyjet-standard.png b/android/assets/1920x1080/polyjet-standard.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1080/splashlogo.png b/android/assets/1920x1080/splashlogo.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1080/square.png b/android/assets/1920x1080/square.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1200/PolyjetTitle.png b/android/assets/1920x1200/PolyjetTitle.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1200/Tech-Circle1.png b/android/assets/1920x1200/Tech-Circle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1200/cybercircle1.png b/android/assets/1920x1200/cybercircle1.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1200/cybercircle3B.png b/android/assets/1920x1200/cybercircle3B.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1200/laser.png b/android/assets/1920x1200/laser.png new file mode 100644 index 0000000..7bdbb7b Binary files /dev/null and b/android/assets/1920x1200/laser.png differ diff --git a/android/assets/1920x1200/polyjet-standard.png b/android/assets/1920x1200/polyjet-standard.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1200/splashlogo.png b/android/assets/1920x1200/splashlogo.png old mode 100755 new mode 100644 diff --git a/android/assets/1920x1200/square.png b/android/assets/1920x1200/square.png old mode 100755 new mode 100644 diff --git a/android/assets/2560x1440/PolyjetTitle.png b/android/assets/2560x1440/PolyjetTitle.png old mode 100755 new mode 100644 diff --git a/android/assets/2560x1440/Tech-Circle1.png b/android/assets/2560x1440/Tech-Circle1.png old mode 100755 new mode 100644 diff --git a/android/assets/2560x1440/cybercircle1.png b/android/assets/2560x1440/cybercircle1.png old mode 100755 new mode 100644 diff --git a/android/assets/2560x1440/cybercircle3B.png b/android/assets/2560x1440/cybercircle3B.png old mode 100755 new mode 100644 diff --git a/android/assets/2560x1440/laser.png b/android/assets/2560x1440/laser.png new file mode 100644 index 0000000..8012158 Binary files /dev/null and b/android/assets/2560x1440/laser.png differ diff --git a/android/assets/2560x1440/polyjet-standard.png b/android/assets/2560x1440/polyjet-standard.png old mode 100755 new mode 100644 diff --git a/android/assets/2560x1440/splashlogo.png b/android/assets/2560x1440/splashlogo.png old mode 100755 new mode 100644 diff --git a/android/assets/2560x1440/square.png b/android/assets/2560x1440/square.png old mode 100755 new mode 100644 diff --git a/android/assets/3840x2160/laser.png b/android/assets/3840x2160/laser.png new file mode 100644 index 0000000..8677ae6 Binary files /dev/null and b/android/assets/3840x2160/laser.png differ diff --git a/android/assets/800x480/PolyjetTitle.png b/android/assets/800x480/PolyjetTitle.png old mode 100755 new mode 100644 diff --git a/android/assets/800x480/Tech-Circle1.png b/android/assets/800x480/Tech-Circle1.png old mode 100755 new mode 100644 diff --git a/android/assets/800x480/cybercircle1.png b/android/assets/800x480/cybercircle1.png old mode 100755 new mode 100644 diff --git a/android/assets/800x480/cybercircle3B.png b/android/assets/800x480/cybercircle3B.png old mode 100755 new mode 100644 diff --git a/android/assets/800x480/laser.png b/android/assets/800x480/laser.png new file mode 100644 index 0000000..4a78859 Binary files /dev/null and b/android/assets/800x480/laser.png differ diff --git a/android/assets/800x480/polyjet-standard.png b/android/assets/800x480/polyjet-standard.png old mode 100755 new mode 100644 diff --git a/android/assets/800x480/splashlogo.png b/android/assets/800x480/splashlogo.png old mode 100755 new mode 100644 diff --git a/android/assets/800x480/square.png b/android/assets/800x480/square.png old mode 100755 new mode 100644 diff --git a/core/src/zero1hd/polyjet/Polyjet.java b/core/src/zero1hd/polyjet/Polyjet.java index 2955eaf..6e57a37 100755 --- a/core/src/zero1hd/polyjet/Polyjet.java +++ b/core/src/zero1hd/polyjet/Polyjet.java @@ -123,6 +123,7 @@ public class Polyjet extends Game { assetManager.load("teleport-cloak.p", ParticleEffect.class); assetManager.load("pop_open.ogg", Sound.class); assetManager.load("pop_close.ogg", Sound.class); + assetManager.load("laser.png", Texture.class); } public void generateFonts() { initComplete = true; diff --git a/core/src/zero1hd/polyjet/entity/CollisionDetector.java b/core/src/zero1hd/polyjet/entity/CollisionDetector.java index 4d4bff9..1c95f63 100755 --- a/core/src/zero1hd/polyjet/entity/CollisionDetector.java +++ b/core/src/zero1hd/polyjet/entity/CollisionDetector.java @@ -1,24 +1,31 @@ package zero1hd.polyjet.entity; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.utils.Array; public class CollisionDetector { Array firstGroup; Array secondGroup; + private boolean debug = true; + public CollisionDetector(Array firstGroup, Array secondGroup) { this.firstGroup = firstGroup; this.secondGroup = secondGroup; } public void collisionCheck() { - while (firstGroup.iterator().hasNext()) { - Entity firstEntity = firstGroup.iterator().next(); - while (secondGroup.iterator().hasNext()) { - Entity secondEntity = secondGroup.iterator().next(); - if (firstEntity.getHitZone().overlaps(secondEntity.getHitZone())) { - firstEntity.collided(secondEntity); - secondEntity.collided(firstEntity); + if (debug) { + Gdx.app.debug("collision check", "First group size: " + firstGroup.size); + Gdx.app.debug("collision check", "Second group size: " + secondGroup.size); + } + + + for (int firstEID = 0; firstEID < firstGroup.size; firstEID++) { + for (int secondEID = 0; secondEID < secondGroup.size; secondEID++) { + if (firstGroup.get(firstEID).getHitZone().overlaps(secondGroup.get(secondEID).getHitZone())) { + firstGroup.get(firstEID).collided(secondGroup.get(secondEID)); + secondGroup.get(secondEID).collided(firstGroup.get(firstEID)); } } } diff --git a/core/src/zero1hd/polyjet/entity/EntityController.java b/core/src/zero1hd/polyjet/entity/EntityController.java index 78344b0..9420d0a 100755 --- a/core/src/zero1hd/polyjet/entity/EntityController.java +++ b/core/src/zero1hd/polyjet/entity/EntityController.java @@ -1,5 +1,6 @@ package zero1hd.polyjet.entity; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; @@ -23,6 +24,8 @@ public class EntityController { public EntityController(ShapeRenderer shapeRenderer, AssetManager assetManager) { ACTIVE_ALLIES = new Array(); ACTIVE_ENEMIES = new Array(); + this.assets = assetManager; + this.shapes = shapeRenderer; //Enemy pool initialization; VOID_CIRCLE_POOL = new Pool() { @@ -43,6 +46,7 @@ public class EntityController { } public Entity retrieveEntity(Entities entity) { + Gdx.app.debug("EntityController", "spawning entity " + entity.name()); switch (entity) { case VOID_CIRCLE: VoidCircle voidCircle = VOID_CIRCLE_POOL.obtain(); diff --git a/core/src/zero1hd/polyjet/entity/ally/Laser.java b/core/src/zero1hd/polyjet/entity/ally/Laser.java index 1d169e0..f6efb5d 100755 --- a/core/src/zero1hd/polyjet/entity/ally/Laser.java +++ b/core/src/zero1hd/polyjet/entity/ally/Laser.java @@ -24,7 +24,7 @@ public class Laser extends Actor implements Entity, Poolable { setX(x); setY(y); this.rate = rate; - setSize(0.25f, 2f); + setSize(0.25f, 1f); hitBox = new Rectangle(); hitBox.setSize(getWidth(), getHeight()); } diff --git a/core/src/zero1hd/polyjet/entity/enemies/VoidCircle.java b/core/src/zero1hd/polyjet/entity/enemies/VoidCircle.java index f55634e..4eafb99 100755 --- a/core/src/zero1hd/polyjet/entity/enemies/VoidCircle.java +++ b/core/src/zero1hd/polyjet/entity/enemies/VoidCircle.java @@ -1,5 +1,6 @@ package zero1hd.polyjet.entity.enemies; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; @@ -12,20 +13,21 @@ import zero1hd.polyjet.entity.Entities; import zero1hd.polyjet.entity.Entity; public class VoidCircle extends Actor implements Entity, Poolable { - float timer; - float endRadius; + private float timer; + private float endRadius; private float currentRadius; - Rectangle hitBox; - ShapeRenderer shapeRenderer; - float growthRate; - boolean done; - - public VoidCircle(ShapeRenderer shapeRenderer) { + private Rectangle hitBox; + private ShapeRenderer shapeRenderer; + private float growthRate; + private boolean done; + private boolean begin; +public VoidCircle(ShapeRenderer shapeRenderer) { hitBox = new Rectangle(); this.shapeRenderer = shapeRenderer; } public void init(float endRadius, float x, float y, float growthRate, float warningTime) { + Gdx.app.debug("Void Circle", "Initiated."); timer = warningTime; this.endRadius = endRadius; setSize(2*endRadius, 2*endRadius); @@ -40,6 +42,7 @@ public class VoidCircle extends Actor implements Entity, Poolable { if (timer > 0) { timer -= delta; } else { + begin = true; if (currentRadius < endRadius) { growCurrentRadius(delta*growthRate); } else { @@ -56,7 +59,9 @@ public class VoidCircle extends Actor implements Entity, Poolable { @Override public void draw(Batch batch, float parentAlpha) { - if (timer <= 0) { + batch.end(); + shapeRenderer.begin(); + if (begin) { shapeRenderer.set(ShapeType.Filled); shapeRenderer.setColor(Color.BLACK); shapeRenderer.circle(getX(), getY(), currentRadius); @@ -64,6 +69,10 @@ public class VoidCircle extends Actor implements Entity, Poolable { shapeRenderer.set(ShapeType.Line); shapeRenderer.setColor(Color.RED); shapeRenderer.circle(getX(), getY(), endRadius); + shapeRenderer.end(); + batch.begin(); + + super.draw(batch, parentAlpha); } @@ -75,6 +84,7 @@ public class VoidCircle extends Actor implements Entity, Poolable { timer = 0; endRadius = 0; done = false; + begin = false; } public void setCurrentRadius(float currentRadius) { diff --git a/core/src/zero1hd/polyjet/screens/CreativeDebugScreen.java b/core/src/zero1hd/polyjet/screens/CreativeDebugScreen.java index 66b03d8..e3e9fee 100755 --- a/core/src/zero1hd/polyjet/screens/CreativeDebugScreen.java +++ b/core/src/zero1hd/polyjet/screens/CreativeDebugScreen.java @@ -18,11 +18,12 @@ public class CreativeDebugScreen extends ScreenAdapter { ShapeRenderer shapes; public CreativeDebugScreen(Polyjet core, MainMenu mainMenu) { - creative = new CreativeStage(core, mainMenu); + gamePlayArea = new GamePlayArea(core.getAssetManager(), shapes); + creative = new CreativeStage(core, mainMenu, gamePlayArea); shapes = new ShapeRenderer(); + shapes.setAutoShapeType(true); - gamePlayArea = new GamePlayArea(core.getAssetManager(), shapes); inputs = new InputMultiplexer(creative, gamePlayArea); } @@ -36,13 +37,10 @@ public class CreativeDebugScreen extends ScreenAdapter { public void render(float delta) { Gdx.gl.glClearColor(1f, 1f, 1f, 1f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); - + gamePlayArea.getViewport().apply(); gamePlayArea.act(); - - shapes.begin(); gamePlayArea.draw(); - shapes.end(); creative.getViewport().apply(); creative.act(); @@ -54,4 +52,10 @@ public class CreativeDebugScreen extends ScreenAdapter { public void resize(int width, int height) { super.resize(width, height); } + + @Override + public void dispose() { + shapes.dispose(); + super.dispose(); + } } diff --git a/core/src/zero1hd/polyjet/screens/GameScreen.java b/core/src/zero1hd/polyjet/screens/GameScreen.java index 8ee0b28..99c1299 100755 --- a/core/src/zero1hd/polyjet/screens/GameScreen.java +++ b/core/src/zero1hd/polyjet/screens/GameScreen.java @@ -125,10 +125,7 @@ public class GameScreen extends ScreenAdapter implements InputProcessor { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); gameArea.getViewport().apply(); - shapeRenderer.begin(); gameArea.draw(); - shapeRenderer.end(); - overlay.getViewport().apply(); overlay.draw(); diff --git a/core/src/zero1hd/polyjet/ui/stages/CreativeStage.java b/core/src/zero1hd/polyjet/ui/stages/CreativeStage.java index 5710dc5..06f5032 100755 --- a/core/src/zero1hd/polyjet/ui/stages/CreativeStage.java +++ b/core/src/zero1hd/polyjet/ui/stages/CreativeStage.java @@ -21,6 +21,7 @@ import zero1hd.polyjet.ui.windows.FPSWindow; import zero1hd.polyjet.ui.windows.GraphWindow; import zero1hd.polyjet.ui.windows.MusicController; import zero1hd.polyjet.ui.windows.MusicSelector; +import zero1hd.polyjet.ui.windows.SpawnerWindow; import zero1hd.polyjet.ui.windows.VolumeWindow; import zero1hd.polyjet.util.MiniEvents; import zero1hd.polyjet.util.MiniListener; @@ -29,25 +30,24 @@ public class CreativeStage extends Stage implements MiniListener { MusicController musicPlayBackControls; MusicSelector musicSelector; FPSWindow fpsViewer; - BeatViewer beatViewer; GraphWindow graphViewer; VolumeWindow volumeWindow; + SpawnerWindow spawnerWindow; AudioAnalyzer analyzer; Window toolbox; - public CreativeStage(final Polyjet core, final MainMenu mainMenu) { + public CreativeStage(final Polyjet core, final MainMenu mainMenu, final GamePlayArea gpa) { musicSelector = new MusicSelector("Select Audio File", core.getDefaultSkin(), core.getPrefs().getString("music dir"), "default"); musicSelector.miniSender.addListener(this); musicSelector.refresh(); fpsViewer = new FPSWindow("FPS", core.getDefaultSkin()); - beatViewer = new BeatViewer("Beat", core.getDefaultSkin()); - graphViewer = new GraphWindow("Peak Values", core.getDefaultSkin()); volumeWindow = new VolumeWindow("Volume adjustments", core.getDefaultSkin(), core.getPrefs()); + spawnerWindow = new SpawnerWindow("Spawn Tool", core.getDefaultSkin(), gpa.entityController, gpa); //Back button TextButton backButton = new TextButton("Back", core.getDefaultSkin()); @@ -148,7 +148,6 @@ public class CreativeStage extends Stage implements MiniListener { final CheckBox volumeMixerCheckbox = new CheckBox(" Volume", core.getDefaultSkin()); volumeMixerCheckbox.addListener(new ChangeListener() { - @Override public void changed(ChangeEvent event, Actor actor) { if (volumeMixerCheckbox.isChecked()) { @@ -158,8 +157,22 @@ public class CreativeStage extends Stage implements MiniListener { } } }); - toolboxToolSet.add(volumeMixerCheckbox); + toolboxToolSet.row(); + + final CheckBox spawnToolCheckBox = new CheckBox(" Spawn Tool", core.getDefaultSkin()); + spawnToolCheckBox.addListener(new ChangeListener() { + @Override + public void changed(ChangeEvent event, Actor actor) { + if (spawnToolCheckBox.isChecked()) { + addActor(spawnerWindow); + } else { + spawnerWindow.remove(); + } + } + }); + toolboxToolSet.add(spawnToolCheckBox); + ScrollPane scroller = new ScrollPane(toolboxToolSet, core.getDefaultSkin()); toolbox.add(scroller).expand().fill(); diff --git a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java index d318145..30e1d9d 100755 --- a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java +++ b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java @@ -19,7 +19,7 @@ import zero1hd.polyjet.entity.ally.PolyJetEntity; public class GamePlayArea extends Stage { public PolyJetEntity polyjet; - private EntityController entityController; + public EntityController entityController; private CollisionDetector collisionDetector; private float maxHealth = 100; diff --git a/core/src/zero1hd/polyjet/ui/windows/SpawnerWindow.java b/core/src/zero1hd/polyjet/ui/windows/SpawnerWindow.java index 9a12dca..2265672 100755 --- a/core/src/zero1hd/polyjet/ui/windows/SpawnerWindow.java +++ b/core/src/zero1hd/polyjet/ui/windows/SpawnerWindow.java @@ -22,8 +22,12 @@ public class SpawnerWindow extends Window { super(title, skin); spawnName = new TextField("", skin); modifier = new TextField("0;0;0", skin); + + add(spawnName, modifier); this.ec = ec; stage = stageForEntities; + setWidth(spawnName.getWidth()+modifier.getWidth()+30f); + setHeight(spawnName.getHeight()+35f); }