new texture added and everything resized; worked on spawning and collision checking
0
android/assets/1280x720/PolyjetTitle.png
Executable file → Normal file
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
0
android/assets/1280x720/Tech-Circle1.png
Executable file → Normal file
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
0
android/assets/1280x720/cybercircle1.png
Executable file → Normal file
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
0
android/assets/1280x720/cybercircle3B.png
Executable file → Normal file
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
BIN
android/assets/1280x720/laser.png
Normal file
After Width: | Height: | Size: 173 B |
0
android/assets/1280x720/polyjet-standard.png
Executable file → Normal file
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 364 B |
0
android/assets/1280x720/splashlogo.png
Executable file → Normal file
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
0
android/assets/1280x720/square.png
Executable file → Normal file
Before Width: | Height: | Size: 96 B After Width: | Height: | Size: 96 B |
0
android/assets/1280x800/PolyjetTitle.png
Executable file → Normal file
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
0
android/assets/1280x800/Tech-Circle1.png
Executable file → Normal file
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
0
android/assets/1280x800/cybercircle1.png
Executable file → Normal file
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
0
android/assets/1280x800/cybercircle3B.png
Executable file → Normal file
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
BIN
android/assets/1280x800/laser.png
Normal file
After Width: | Height: | Size: 191 B |
0
android/assets/1280x800/polyjet-standard.png
Executable file → Normal file
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
0
android/assets/1280x800/splashlogo.png
Executable file → Normal file
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
0
android/assets/1280x800/square.png
Executable file → Normal file
Before Width: | Height: | Size: 100 B After Width: | Height: | Size: 100 B |
0
android/assets/1366x768/PolyjetTitle.png
Executable file → Normal file
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
0
android/assets/1366x768/Tech-Circle1.png
Executable file → Normal file
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
0
android/assets/1366x768/cybercircle1.png
Executable file → Normal file
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
0
android/assets/1366x768/cybercircle3B.png
Executable file → Normal file
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
BIN
android/assets/1366x768/laser.png
Normal file
After Width: | Height: | Size: 182 B |
0
android/assets/1366x768/polyjet-standard.png
Executable file → Normal file
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 421 B |
0
android/assets/1366x768/splashlogo.png
Executable file → Normal file
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
0
android/assets/1366x768/square.png
Executable file → Normal file
Before Width: | Height: | Size: 98 B After Width: | Height: | Size: 98 B |
0
android/assets/1920x1080/PolyjetTitle.png
Executable file → Normal file
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
0
android/assets/1920x1080/Tech-Circle1.png
Executable file → Normal file
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
0
android/assets/1920x1080/cybercircle1.png
Executable file → Normal file
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
0
android/assets/1920x1080/cybercircle3B.png
Executable file → Normal file
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
BIN
android/assets/1920x1080/laser.png
Normal file
After Width: | Height: | Size: 300 B |
0
android/assets/1920x1080/polyjet-standard.png
Executable file → Normal file
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 378 B |
0
android/assets/1920x1080/splashlogo.png
Executable file → Normal file
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
0
android/assets/1920x1080/square.png
Executable file → Normal file
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 114 B |
0
android/assets/1920x1200/PolyjetTitle.png
Executable file → Normal file
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
0
android/assets/1920x1200/Tech-Circle1.png
Executable file → Normal file
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
0
android/assets/1920x1200/cybercircle1.png
Executable file → Normal file
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
0
android/assets/1920x1200/cybercircle3B.png
Executable file → Normal file
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
BIN
android/assets/1920x1200/laser.png
Normal file
After Width: | Height: | Size: 355 B |
0
android/assets/1920x1200/polyjet-standard.png
Executable file → Normal file
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 839 B |
0
android/assets/1920x1200/splashlogo.png
Executable file → Normal file
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
0
android/assets/1920x1200/square.png
Executable file → Normal file
Before Width: | Height: | Size: 122 B After Width: | Height: | Size: 122 B |
0
android/assets/2560x1440/PolyjetTitle.png
Executable file → Normal file
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
0
android/assets/2560x1440/Tech-Circle1.png
Executable file → Normal file
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 123 KiB |
0
android/assets/2560x1440/cybercircle1.png
Executable file → Normal file
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
0
android/assets/2560x1440/cybercircle3B.png
Executable file → Normal file
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
BIN
android/assets/2560x1440/laser.png
Normal file
After Width: | Height: | Size: 440 B |
0
android/assets/2560x1440/polyjet-standard.png
Executable file → Normal file
Before Width: | Height: | Size: 1022 B After Width: | Height: | Size: 1022 B |
0
android/assets/2560x1440/splashlogo.png
Executable file → Normal file
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
0
android/assets/2560x1440/square.png
Executable file → Normal file
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 139 B |
BIN
android/assets/3840x2160/laser.png
Normal file
After Width: | Height: | Size: 579 B |
0
android/assets/800x480/PolyjetTitle.png
Executable file → Normal file
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
0
android/assets/800x480/Tech-Circle1.png
Executable file → Normal file
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
0
android/assets/800x480/cybercircle1.png
Executable file → Normal file
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
0
android/assets/800x480/cybercircle3B.png
Executable file → Normal file
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
BIN
android/assets/800x480/laser.png
Normal file
After Width: | Height: | Size: 137 B |
0
android/assets/800x480/polyjet-standard.png
Executable file → Normal file
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 266 B |
0
android/assets/800x480/splashlogo.png
Executable file → Normal file
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
0
android/assets/800x480/square.png
Executable file → Normal file
Before Width: | Height: | Size: 84 B After Width: | Height: | Size: 84 B |
@ -123,6 +123,7 @@ public class Polyjet extends Game {
|
|||||||
assetManager.load("teleport-cloak.p", ParticleEffect.class);
|
assetManager.load("teleport-cloak.p", ParticleEffect.class);
|
||||||
assetManager.load("pop_open.ogg", Sound.class);
|
assetManager.load("pop_open.ogg", Sound.class);
|
||||||
assetManager.load("pop_close.ogg", Sound.class);
|
assetManager.load("pop_close.ogg", Sound.class);
|
||||||
|
assetManager.load("laser.png", Texture.class);
|
||||||
}
|
}
|
||||||
public void generateFonts() {
|
public void generateFonts() {
|
||||||
initComplete = true;
|
initComplete = true;
|
||||||
|
@ -1,24 +1,31 @@
|
|||||||
package zero1hd.polyjet.entity;
|
package zero1hd.polyjet.entity;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
|
||||||
public class CollisionDetector {
|
public class CollisionDetector {
|
||||||
Array<Entity> firstGroup;
|
Array<Entity> firstGroup;
|
||||||
Array<Entity> secondGroup;
|
Array<Entity> secondGroup;
|
||||||
|
|
||||||
|
private boolean debug = true;
|
||||||
|
|
||||||
public CollisionDetector(Array<Entity> firstGroup, Array<Entity> secondGroup) {
|
public CollisionDetector(Array<Entity> firstGroup, Array<Entity> secondGroup) {
|
||||||
this.firstGroup = firstGroup;
|
this.firstGroup = firstGroup;
|
||||||
this.secondGroup = secondGroup;
|
this.secondGroup = secondGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void collisionCheck() {
|
public void collisionCheck() {
|
||||||
while (firstGroup.iterator().hasNext()) {
|
if (debug) {
|
||||||
Entity firstEntity = firstGroup.iterator().next();
|
Gdx.app.debug("collision check", "First group size: " + firstGroup.size);
|
||||||
while (secondGroup.iterator().hasNext()) {
|
Gdx.app.debug("collision check", "Second group size: " + secondGroup.size);
|
||||||
Entity secondEntity = secondGroup.iterator().next();
|
}
|
||||||
if (firstEntity.getHitZone().overlaps(secondEntity.getHitZone())) {
|
|
||||||
firstEntity.collided(secondEntity);
|
|
||||||
secondEntity.collided(firstEntity);
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package zero1hd.polyjet.entity;
|
package zero1hd.polyjet.entity;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.assets.AssetManager;
|
import com.badlogic.gdx.assets.AssetManager;
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||||
@ -23,6 +24,8 @@ public class EntityController {
|
|||||||
public EntityController(ShapeRenderer shapeRenderer, AssetManager assetManager) {
|
public EntityController(ShapeRenderer shapeRenderer, AssetManager assetManager) {
|
||||||
ACTIVE_ALLIES = new Array<Entity>();
|
ACTIVE_ALLIES = new Array<Entity>();
|
||||||
ACTIVE_ENEMIES = new Array<Entity>();
|
ACTIVE_ENEMIES = new Array<Entity>();
|
||||||
|
this.assets = assetManager;
|
||||||
|
this.shapes = shapeRenderer;
|
||||||
|
|
||||||
//Enemy pool initialization;
|
//Enemy pool initialization;
|
||||||
VOID_CIRCLE_POOL = new Pool<VoidCircle>() {
|
VOID_CIRCLE_POOL = new Pool<VoidCircle>() {
|
||||||
@ -43,6 +46,7 @@ public class EntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Entity retrieveEntity(Entities entity) {
|
public Entity retrieveEntity(Entities entity) {
|
||||||
|
Gdx.app.debug("EntityController", "spawning entity " + entity.name());
|
||||||
switch (entity) {
|
switch (entity) {
|
||||||
case VOID_CIRCLE:
|
case VOID_CIRCLE:
|
||||||
VoidCircle voidCircle = VOID_CIRCLE_POOL.obtain();
|
VoidCircle voidCircle = VOID_CIRCLE_POOL.obtain();
|
||||||
|
@ -24,7 +24,7 @@ public class Laser extends Actor implements Entity, Poolable {
|
|||||||
setX(x);
|
setX(x);
|
||||||
setY(y);
|
setY(y);
|
||||||
this.rate = rate;
|
this.rate = rate;
|
||||||
setSize(0.25f, 2f);
|
setSize(0.25f, 1f);
|
||||||
hitBox = new Rectangle();
|
hitBox = new Rectangle();
|
||||||
hitBox.setSize(getWidth(), getHeight());
|
hitBox.setSize(getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package zero1hd.polyjet.entity.enemies;
|
package zero1hd.polyjet.entity.enemies;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||||
@ -12,20 +13,21 @@ import zero1hd.polyjet.entity.Entities;
|
|||||||
import zero1hd.polyjet.entity.Entity;
|
import zero1hd.polyjet.entity.Entity;
|
||||||
|
|
||||||
public class VoidCircle extends Actor implements Entity, Poolable {
|
public class VoidCircle extends Actor implements Entity, Poolable {
|
||||||
float timer;
|
private float timer;
|
||||||
float endRadius;
|
private float endRadius;
|
||||||
private float currentRadius;
|
private float currentRadius;
|
||||||
Rectangle hitBox;
|
private Rectangle hitBox;
|
||||||
ShapeRenderer shapeRenderer;
|
private ShapeRenderer shapeRenderer;
|
||||||
float growthRate;
|
private float growthRate;
|
||||||
boolean done;
|
private boolean done;
|
||||||
|
private boolean begin;
|
||||||
public VoidCircle(ShapeRenderer shapeRenderer) {
|
public VoidCircle(ShapeRenderer shapeRenderer) {
|
||||||
hitBox = new Rectangle();
|
hitBox = new Rectangle();
|
||||||
this.shapeRenderer = shapeRenderer;
|
this.shapeRenderer = shapeRenderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(float endRadius, float x, float y, float growthRate, float warningTime) {
|
public void init(float endRadius, float x, float y, float growthRate, float warningTime) {
|
||||||
|
Gdx.app.debug("Void Circle", "Initiated.");
|
||||||
timer = warningTime;
|
timer = warningTime;
|
||||||
this.endRadius = endRadius;
|
this.endRadius = endRadius;
|
||||||
setSize(2*endRadius, 2*endRadius);
|
setSize(2*endRadius, 2*endRadius);
|
||||||
@ -40,6 +42,7 @@ public class VoidCircle extends Actor implements Entity, Poolable {
|
|||||||
if (timer > 0) {
|
if (timer > 0) {
|
||||||
timer -= delta;
|
timer -= delta;
|
||||||
} else {
|
} else {
|
||||||
|
begin = true;
|
||||||
if (currentRadius < endRadius) {
|
if (currentRadius < endRadius) {
|
||||||
growCurrentRadius(delta*growthRate);
|
growCurrentRadius(delta*growthRate);
|
||||||
} else {
|
} else {
|
||||||
@ -56,7 +59,9 @@ public class VoidCircle extends Actor implements Entity, Poolable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Batch batch, float parentAlpha) {
|
public void draw(Batch batch, float parentAlpha) {
|
||||||
if (timer <= 0) {
|
batch.end();
|
||||||
|
shapeRenderer.begin();
|
||||||
|
if (begin) {
|
||||||
shapeRenderer.set(ShapeType.Filled);
|
shapeRenderer.set(ShapeType.Filled);
|
||||||
shapeRenderer.setColor(Color.BLACK);
|
shapeRenderer.setColor(Color.BLACK);
|
||||||
shapeRenderer.circle(getX(), getY(), currentRadius);
|
shapeRenderer.circle(getX(), getY(), currentRadius);
|
||||||
@ -64,6 +69,10 @@ public class VoidCircle extends Actor implements Entity, Poolable {
|
|||||||
shapeRenderer.set(ShapeType.Line);
|
shapeRenderer.set(ShapeType.Line);
|
||||||
shapeRenderer.setColor(Color.RED);
|
shapeRenderer.setColor(Color.RED);
|
||||||
shapeRenderer.circle(getX(), getY(), endRadius);
|
shapeRenderer.circle(getX(), getY(), endRadius);
|
||||||
|
shapeRenderer.end();
|
||||||
|
batch.begin();
|
||||||
|
|
||||||
|
|
||||||
super.draw(batch, parentAlpha);
|
super.draw(batch, parentAlpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,6 +84,7 @@ public class VoidCircle extends Actor implements Entity, Poolable {
|
|||||||
timer = 0;
|
timer = 0;
|
||||||
endRadius = 0;
|
endRadius = 0;
|
||||||
done = false;
|
done = false;
|
||||||
|
begin = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCurrentRadius(float currentRadius) {
|
public void setCurrentRadius(float currentRadius) {
|
||||||
|
@ -18,11 +18,12 @@ public class CreativeDebugScreen extends ScreenAdapter {
|
|||||||
ShapeRenderer shapes;
|
ShapeRenderer shapes;
|
||||||
|
|
||||||
public CreativeDebugScreen(Polyjet core, MainMenu mainMenu) {
|
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 = new ShapeRenderer();
|
||||||
|
shapes.setAutoShapeType(true);
|
||||||
|
|
||||||
gamePlayArea = new GamePlayArea(core.getAssetManager(), shapes);
|
|
||||||
inputs = new InputMultiplexer(creative, gamePlayArea);
|
inputs = new InputMultiplexer(creative, gamePlayArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,10 +40,7 @@ public class CreativeDebugScreen extends ScreenAdapter {
|
|||||||
|
|
||||||
gamePlayArea.getViewport().apply();
|
gamePlayArea.getViewport().apply();
|
||||||
gamePlayArea.act();
|
gamePlayArea.act();
|
||||||
|
|
||||||
shapes.begin();
|
|
||||||
gamePlayArea.draw();
|
gamePlayArea.draw();
|
||||||
shapes.end();
|
|
||||||
|
|
||||||
creative.getViewport().apply();
|
creative.getViewport().apply();
|
||||||
creative.act();
|
creative.act();
|
||||||
@ -54,4 +52,10 @@ public class CreativeDebugScreen extends ScreenAdapter {
|
|||||||
public void resize(int width, int height) {
|
public void resize(int width, int height) {
|
||||||
super.resize(width, height);
|
super.resize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose() {
|
||||||
|
shapes.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,10 +125,7 @@ public class GameScreen extends ScreenAdapter implements InputProcessor {
|
|||||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
|
||||||
gameArea.getViewport().apply();
|
gameArea.getViewport().apply();
|
||||||
|
|
||||||
shapeRenderer.begin();
|
|
||||||
gameArea.draw();
|
gameArea.draw();
|
||||||
shapeRenderer.end();
|
|
||||||
|
|
||||||
|
|
||||||
overlay.getViewport().apply();
|
overlay.getViewport().apply();
|
||||||
overlay.draw();
|
overlay.draw();
|
||||||
|
@ -21,6 +21,7 @@ import zero1hd.polyjet.ui.windows.FPSWindow;
|
|||||||
import zero1hd.polyjet.ui.windows.GraphWindow;
|
import zero1hd.polyjet.ui.windows.GraphWindow;
|
||||||
import zero1hd.polyjet.ui.windows.MusicController;
|
import zero1hd.polyjet.ui.windows.MusicController;
|
||||||
import zero1hd.polyjet.ui.windows.MusicSelector;
|
import zero1hd.polyjet.ui.windows.MusicSelector;
|
||||||
|
import zero1hd.polyjet.ui.windows.SpawnerWindow;
|
||||||
import zero1hd.polyjet.ui.windows.VolumeWindow;
|
import zero1hd.polyjet.ui.windows.VolumeWindow;
|
||||||
import zero1hd.polyjet.util.MiniEvents;
|
import zero1hd.polyjet.util.MiniEvents;
|
||||||
import zero1hd.polyjet.util.MiniListener;
|
import zero1hd.polyjet.util.MiniListener;
|
||||||
@ -29,25 +30,24 @@ public class CreativeStage extends Stage implements MiniListener {
|
|||||||
MusicController musicPlayBackControls;
|
MusicController musicPlayBackControls;
|
||||||
MusicSelector musicSelector;
|
MusicSelector musicSelector;
|
||||||
FPSWindow fpsViewer;
|
FPSWindow fpsViewer;
|
||||||
|
|
||||||
BeatViewer beatViewer;
|
BeatViewer beatViewer;
|
||||||
GraphWindow graphViewer;
|
GraphWindow graphViewer;
|
||||||
VolumeWindow volumeWindow;
|
VolumeWindow volumeWindow;
|
||||||
|
SpawnerWindow spawnerWindow;
|
||||||
|
|
||||||
AudioAnalyzer analyzer;
|
AudioAnalyzer analyzer;
|
||||||
Window toolbox;
|
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 = new MusicSelector("Select Audio File", core.getDefaultSkin(), core.getPrefs().getString("music dir"), "default");
|
||||||
musicSelector.miniSender.addListener(this);
|
musicSelector.miniSender.addListener(this);
|
||||||
musicSelector.refresh();
|
musicSelector.refresh();
|
||||||
|
|
||||||
fpsViewer = new FPSWindow("FPS", core.getDefaultSkin());
|
fpsViewer = new FPSWindow("FPS", core.getDefaultSkin());
|
||||||
|
|
||||||
beatViewer = new BeatViewer("Beat", core.getDefaultSkin());
|
beatViewer = new BeatViewer("Beat", core.getDefaultSkin());
|
||||||
|
|
||||||
graphViewer = new GraphWindow("Peak Values", core.getDefaultSkin());
|
graphViewer = new GraphWindow("Peak Values", core.getDefaultSkin());
|
||||||
volumeWindow = new VolumeWindow("Volume adjustments", core.getDefaultSkin(), core.getPrefs());
|
volumeWindow = new VolumeWindow("Volume adjustments", core.getDefaultSkin(), core.getPrefs());
|
||||||
|
spawnerWindow = new SpawnerWindow("Spawn Tool", core.getDefaultSkin(), gpa.entityController, gpa);
|
||||||
|
|
||||||
//Back button
|
//Back button
|
||||||
TextButton backButton = new TextButton("Back", core.getDefaultSkin());
|
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());
|
final CheckBox volumeMixerCheckbox = new CheckBox(" Volume", core.getDefaultSkin());
|
||||||
volumeMixerCheckbox.addListener(new ChangeListener() {
|
volumeMixerCheckbox.addListener(new ChangeListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changed(ChangeEvent event, Actor actor) {
|
public void changed(ChangeEvent event, Actor actor) {
|
||||||
if (volumeMixerCheckbox.isChecked()) {
|
if (volumeMixerCheckbox.isChecked()) {
|
||||||
@ -158,8 +157,22 @@ public class CreativeStage extends Stage implements MiniListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
toolboxToolSet.add(volumeMixerCheckbox);
|
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());
|
ScrollPane scroller = new ScrollPane(toolboxToolSet, core.getDefaultSkin());
|
||||||
toolbox.add(scroller).expand().fill();
|
toolbox.add(scroller).expand().fill();
|
||||||
|
@ -19,7 +19,7 @@ import zero1hd.polyjet.entity.ally.PolyJetEntity;
|
|||||||
public class GamePlayArea extends Stage {
|
public class GamePlayArea extends Stage {
|
||||||
public PolyJetEntity polyjet;
|
public PolyJetEntity polyjet;
|
||||||
|
|
||||||
private EntityController entityController;
|
public EntityController entityController;
|
||||||
private CollisionDetector collisionDetector;
|
private CollisionDetector collisionDetector;
|
||||||
|
|
||||||
private float maxHealth = 100;
|
private float maxHealth = 100;
|
||||||
|
@ -22,8 +22,12 @@ public class SpawnerWindow extends Window {
|
|||||||
super(title, skin);
|
super(title, skin);
|
||||||
spawnName = new TextField("", skin);
|
spawnName = new TextField("", skin);
|
||||||
modifier = new TextField("0;0;0", skin);
|
modifier = new TextField("0;0;0", skin);
|
||||||
|
|
||||||
|
add(spawnName, modifier);
|
||||||
this.ec = ec;
|
this.ec = ec;
|
||||||
stage = stageForEntities;
|
stage = stageForEntities;
|
||||||
|
setWidth(spawnName.getWidth()+modifier.getWidth()+30f);
|
||||||
|
setHeight(spawnName.getHeight()+35f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|