From 70bf120a5f2871226dd75ae6603153a6765f03b5 Mon Sep 17 00:00:00 2001 From: Recrown Date: Wed, 31 May 2017 13:49:18 -0500 Subject: [PATCH] new texture added and everything resized; worked on spawning and collision checking --- android/assets/1280x720/PolyjetTitle.png | Bin android/assets/1280x720/Tech-Circle1.png | Bin android/assets/1280x720/cybercircle1.png | Bin android/assets/1280x720/cybercircle3B.png | Bin android/assets/1280x720/laser.png | Bin 0 -> 173 bytes android/assets/1280x720/polyjet-standard.png | Bin android/assets/1280x720/splashlogo.png | Bin android/assets/1280x720/square.png | Bin android/assets/1280x800/PolyjetTitle.png | Bin android/assets/1280x800/Tech-Circle1.png | Bin android/assets/1280x800/cybercircle1.png | Bin android/assets/1280x800/cybercircle3B.png | Bin android/assets/1280x800/laser.png | Bin 0 -> 191 bytes android/assets/1280x800/polyjet-standard.png | Bin android/assets/1280x800/splashlogo.png | Bin android/assets/1280x800/square.png | Bin android/assets/1366x768/PolyjetTitle.png | Bin android/assets/1366x768/Tech-Circle1.png | Bin android/assets/1366x768/cybercircle1.png | Bin android/assets/1366x768/cybercircle3B.png | Bin android/assets/1366x768/laser.png | Bin 0 -> 182 bytes android/assets/1366x768/polyjet-standard.png | Bin android/assets/1366x768/splashlogo.png | Bin android/assets/1366x768/square.png | Bin android/assets/1920x1080/PolyjetTitle.png | Bin android/assets/1920x1080/Tech-Circle1.png | Bin android/assets/1920x1080/cybercircle1.png | Bin android/assets/1920x1080/cybercircle3B.png | Bin android/assets/1920x1080/laser.png | Bin 0 -> 300 bytes android/assets/1920x1080/polyjet-standard.png | Bin android/assets/1920x1080/splashlogo.png | Bin android/assets/1920x1080/square.png | Bin android/assets/1920x1200/PolyjetTitle.png | Bin android/assets/1920x1200/Tech-Circle1.png | Bin android/assets/1920x1200/cybercircle1.png | Bin android/assets/1920x1200/cybercircle3B.png | Bin android/assets/1920x1200/laser.png | Bin 0 -> 355 bytes android/assets/1920x1200/polyjet-standard.png | Bin android/assets/1920x1200/splashlogo.png | Bin android/assets/1920x1200/square.png | Bin android/assets/2560x1440/PolyjetTitle.png | Bin android/assets/2560x1440/Tech-Circle1.png | Bin android/assets/2560x1440/cybercircle1.png | Bin android/assets/2560x1440/cybercircle3B.png | Bin android/assets/2560x1440/laser.png | Bin 0 -> 440 bytes android/assets/2560x1440/polyjet-standard.png | Bin android/assets/2560x1440/splashlogo.png | Bin android/assets/2560x1440/square.png | Bin android/assets/3840x2160/laser.png | Bin 0 -> 579 bytes android/assets/800x480/PolyjetTitle.png | Bin android/assets/800x480/Tech-Circle1.png | Bin android/assets/800x480/cybercircle1.png | Bin android/assets/800x480/cybercircle3B.png | Bin android/assets/800x480/laser.png | Bin 0 -> 137 bytes android/assets/800x480/polyjet-standard.png | Bin android/assets/800x480/splashlogo.png | Bin android/assets/800x480/square.png | Bin core/src/zero1hd/polyjet/Polyjet.java | 1 + .../polyjet/entity/CollisionDetector.java | 21 ++++++++----- .../polyjet/entity/EntityController.java | 4 +++ .../zero1hd/polyjet/entity/ally/Laser.java | 2 +- .../polyjet/entity/enemies/VoidCircle.java | 28 ++++++++++++------ .../polyjet/screens/CreativeDebugScreen.java | 16 ++++++---- .../zero1hd/polyjet/screens/GameScreen.java | 3 -- .../polyjet/ui/stages/CreativeStage.java | 25 ++++++++++++---- .../polyjet/ui/stages/GamePlayArea.java | 2 +- .../polyjet/ui/windows/SpawnerWindow.java | 4 +++ 67 files changed, 73 insertions(+), 33 deletions(-) mode change 100755 => 100644 android/assets/1280x720/PolyjetTitle.png mode change 100755 => 100644 android/assets/1280x720/Tech-Circle1.png mode change 100755 => 100644 android/assets/1280x720/cybercircle1.png mode change 100755 => 100644 android/assets/1280x720/cybercircle3B.png create mode 100644 android/assets/1280x720/laser.png mode change 100755 => 100644 android/assets/1280x720/polyjet-standard.png mode change 100755 => 100644 android/assets/1280x720/splashlogo.png mode change 100755 => 100644 android/assets/1280x720/square.png mode change 100755 => 100644 android/assets/1280x800/PolyjetTitle.png mode change 100755 => 100644 android/assets/1280x800/Tech-Circle1.png mode change 100755 => 100644 android/assets/1280x800/cybercircle1.png mode change 100755 => 100644 android/assets/1280x800/cybercircle3B.png create mode 100644 android/assets/1280x800/laser.png mode change 100755 => 100644 android/assets/1280x800/polyjet-standard.png mode change 100755 => 100644 android/assets/1280x800/splashlogo.png mode change 100755 => 100644 android/assets/1280x800/square.png mode change 100755 => 100644 android/assets/1366x768/PolyjetTitle.png mode change 100755 => 100644 android/assets/1366x768/Tech-Circle1.png mode change 100755 => 100644 android/assets/1366x768/cybercircle1.png mode change 100755 => 100644 android/assets/1366x768/cybercircle3B.png create mode 100644 android/assets/1366x768/laser.png mode change 100755 => 100644 android/assets/1366x768/polyjet-standard.png mode change 100755 => 100644 android/assets/1366x768/splashlogo.png mode change 100755 => 100644 android/assets/1366x768/square.png mode change 100755 => 100644 android/assets/1920x1080/PolyjetTitle.png mode change 100755 => 100644 android/assets/1920x1080/Tech-Circle1.png mode change 100755 => 100644 android/assets/1920x1080/cybercircle1.png mode change 100755 => 100644 android/assets/1920x1080/cybercircle3B.png create mode 100644 android/assets/1920x1080/laser.png mode change 100755 => 100644 android/assets/1920x1080/polyjet-standard.png mode change 100755 => 100644 android/assets/1920x1080/splashlogo.png mode change 100755 => 100644 android/assets/1920x1080/square.png mode change 100755 => 100644 android/assets/1920x1200/PolyjetTitle.png mode change 100755 => 100644 android/assets/1920x1200/Tech-Circle1.png mode change 100755 => 100644 android/assets/1920x1200/cybercircle1.png mode change 100755 => 100644 android/assets/1920x1200/cybercircle3B.png create mode 100644 android/assets/1920x1200/laser.png mode change 100755 => 100644 android/assets/1920x1200/polyjet-standard.png mode change 100755 => 100644 android/assets/1920x1200/splashlogo.png mode change 100755 => 100644 android/assets/1920x1200/square.png mode change 100755 => 100644 android/assets/2560x1440/PolyjetTitle.png mode change 100755 => 100644 android/assets/2560x1440/Tech-Circle1.png mode change 100755 => 100644 android/assets/2560x1440/cybercircle1.png mode change 100755 => 100644 android/assets/2560x1440/cybercircle3B.png create mode 100644 android/assets/2560x1440/laser.png mode change 100755 => 100644 android/assets/2560x1440/polyjet-standard.png mode change 100755 => 100644 android/assets/2560x1440/splashlogo.png mode change 100755 => 100644 android/assets/2560x1440/square.png create mode 100644 android/assets/3840x2160/laser.png mode change 100755 => 100644 android/assets/800x480/PolyjetTitle.png mode change 100755 => 100644 android/assets/800x480/Tech-Circle1.png mode change 100755 => 100644 android/assets/800x480/cybercircle1.png mode change 100755 => 100644 android/assets/800x480/cybercircle3B.png create mode 100644 android/assets/800x480/laser.png mode change 100755 => 100644 android/assets/800x480/polyjet-standard.png mode change 100755 => 100644 android/assets/800x480/splashlogo.png mode change 100755 => 100644 android/assets/800x480/square.png 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 0000000000000000000000000000000000000000..195d4d535e4ee6fc61766a39b82ccc12c3cdff13 GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^EI`c9!3HD`o8|2VQYD@)jv*Ddk|%tMc%%MwqekSZ z+QLOWzaNRPWo~c%c=2p_f2(=SE|s_2EG9c1OHMq~b2eYzKkEN4(+F0Ngj>tD_c#1d z?C90`(D9Fn{~=S*yY5ZZVS9gd1TdDY3%ql0tJ}xwu*N^EpJF|X&%*Cm za$--Q$<5w|*vfU;ptoi(W<*SKV(wq_r3e$+sTq0T-#fBntq*niZluOE>ym`R1z7-^9|iG)6pv hdGCAOm%9$|GW4!%zU~~c`6JLF44$rjF6*2UngBJoO!EK$ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..785cbc6df35b59d48b5de6dcfc6c8b827d207753 GIT binary patch literal 300 zcmV+{0n`48P)|gWxLHEj6Ph|Z!AD8i1O;f4DyeEGKT{FiU4 z5r-B?x-M`-NSr4i0b+y1Mz91ZT$Ce@%*U!jDeTZ{VCeohaN)~$P!xbAq}>;L%Lnf{ zzxnv5pF2-~`Jxzd0000X1^@s6{f;y^0003hNkl>gv0TO4B_E_Sq7`U~!f6bfwXK#J`-?-?-XF1Hc1koV=s3f%{ zxAfqa1jYg=HZUYX$wbzF^U{tLFW-VBC#`?;02IG)Ng1DYo3kc7c)9iDr;nvGpI(vo z+X#`A^;qOCQj~F9oF?tDs1hhq z4^Bf;Zi{@SJ(pO>xi8QLVJVMAHo&CmE#t9J4*<<_XFy>XIlKS>002ovPDHLkV1n>v Bp!Wa( literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..80121587f48573d0eef9c65a08a103b6b01bb7ba GIT binary patch literal 440 zcmV;p0Z0CcP)gk?MydC9mf^py2j=Qfea!%}24&J(3%6(ynjOQYI1{sgV4nUnX zK2^7muH66O&CFFbvzy1U&_!-;z=q$)okQ`h=Y}b=hAW0C8?|O1l#(i-)vKvqofY@Lk;WA-V!BAEJ zN~pLM022i$aU^s-Ie}FHG*x#;v_85Al>Bq_%GX~>Jx|Uc6u2#Nl5t-&*RST*yM5hFYEo|VH6%Qj iXhFheiL<23B255FR_g6tVTGOm0000d?(?jnfd1BeK|fESeyFE;|Od=BToQ7tgdcLaa zDyUzpW;%Wcn(P?r7xbev3=N|@Hl})B0Z6(c$^g3FGhq@c{KN^~jv~Lx_ zb#S@?DC<0xrHTeoWJ;+E;Cm>B$VSl}zO?>#FPtY&T51lYK)D^^Z_79O!7e~Khpx+x z`WN7jwFmaV9@qo_2YA4WY>3Iu2r3S%U4Rd>f0&nkB#I;+wzLwFO(zmWF9D9d_b1NN zi-$&Iv?#V`s}HmDz!i)3Wm?@tHBFaxo!wa1Ox*;a0IqC)HGTCilgYdi=aA1oieF!$rHZC$SjxLx76=c zt*2RY(t~Z2)~egrPUOFFjpfN3otx$VPMaTHAbXU9Z-Uw^<|`b}PyEi$n!Eq;SMHw; mx<`3} 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); }