new framework for entities progress and began working on map part

This commit is contained in:
Harrison Deng 2017-07-28 14:11:55 -05:00
parent 66e82c0efe
commit 5ec04f0f27
35 changed files with 98 additions and 70 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 KiB

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 KiB

After

Width:  |  Height:  |  Size: 799 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 754 KiB

After

Width:  |  Height:  |  Size: 754 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 KiB

After

Width:  |  Height:  |  Size: 366 KiB

View File

@ -68,10 +68,10 @@ public class GamePlayMap {
* @return the object. * @return the object.
*/ */
public EntitySpawnInfo nextEntitySpawnInfo(EntityIndex entityType) { public EntitySpawnInfo nextEntitySpawnInfo(EntityIndex entityType) {
EntitySpawnInfo esi = new EntitySpawnInfo(entityType);
if (spawnList.get(index) == null) { if (spawnList.get(index) == null) {
spawnList.set(index, new MapWindowData()); spawnList.set(index, new MapWindowData());
} }
EntitySpawnInfo esi = new EntitySpawnInfo(entityType);
spawnList.get(index).addEntity(esi); spawnList.get(index).addEntity(esi);
return esi; return esi;
} }
@ -81,7 +81,8 @@ public class GamePlayMap {
*/ */
public void nextWindow() { public void nextWindow() {
if (building) { if (building) {
index++; spawnList.add(new MapWindowData());
resetIndex();
} }
} }
@ -117,7 +118,7 @@ public class GamePlayMap {
*/ */
public void addNullToMap() { public void addNullToMap() {
if (building) { if (building) {
spawnList.set(index, null); spawnList.add(null);
} }
} }
public MapWindowData nextWindowData() { public MapWindowData nextWindowData() {

View File

@ -13,8 +13,8 @@ import com.badlogic.gdx.utils.Array;
import zero1hd.polyjet.Main; import zero1hd.polyjet.Main;
public class CollisionDetector { public class CollisionDetector {
Array<Entity> firstGroup; Array<Entity> enemies;
Array<Entity> secondGroup; Array<Entity> allies;
AssetManager assets; AssetManager assets;
Preferences prefs; Preferences prefs;
@ -23,9 +23,9 @@ public class CollisionDetector {
Array<PooledEffect> effects = new Array<>(); Array<PooledEffect> effects = new Array<>();
Sound explosionSFX; Sound explosionSFX;
public CollisionDetector(Array<Entity> firstGroup, Array<Entity> secondGroup, AssetManager assetManager, Preferences prefs) { public CollisionDetector(Array<Entity> enemies, Array<Entity> allies, AssetManager assetManager, Preferences prefs) {
this.firstGroup = firstGroup; this.enemies = enemies;
this.secondGroup = secondGroup; this.allies = allies;
assets = assetManager; assets = assetManager;
this.prefs = prefs; this.prefs = prefs;
@ -34,28 +34,28 @@ public class CollisionDetector {
} }
public void collisionCheck() { public void collisionCheck() {
if ((firstGroup.size != 0) && (secondGroup.size != 0)) { if ((enemies.size != 0) && (allies.size != 0)) {
for (int f = 0; f < firstGroup.size; f++) { for (int f = 0; f < enemies.size; f++) {
Entity fe = firstGroup.get(f); Entity enemy = enemies.get(f);
for (int s = 0; s < secondGroup.size; s++) { for (int s = 0; s < allies.size; s++) {
Entity se = secondGroup.get(s); Entity ally = allies.get(s);
if (fe.getHitZone().overlaps(se.getHitZone())) { if (enemy.getHitZone().overlaps(ally.getHitZone())) {
Gdx.app.debug("Collision Detector", "Collision between entities: " + fe.getEntityType() + " and " + se.getEntityType()); Gdx.app.debug("Collision Detector", "Collision between entities: " + enemy.getEntityType() + " and " + ally.getEntityType());
//Play FX; //Play FX;
if (se.playCollideSFX() && fe.playCollideSFX()) { if (ally.playCollideSFX() && enemy.playCollideSFX()) {
explosionSFX.play(prefs.getFloat("fx vol"), 1f, (fe.getX()/Main.GAME_AREA_WIDTH)-0.55f); explosionSFX.play(prefs.getFloat("fx vol"), 1f, (enemy.getX()/Main.GAME_AREA_WIDTH)-0.55f);
} }
if (se.playCollidePFX() && fe.playCollidePFX()) { if (ally.playCollidePFX() && enemy.playCollidePFX()) {
PooledEffect currentPFX; PooledEffect currentPFX;
currentPFX = explosionEffectPool.obtain(); currentPFX = explosionEffectPool.obtain();
currentPFX.setPosition(fe.getX() + fe.getWidth()/2f, fe.getY() + fe.getHeight()/2f); currentPFX.setPosition(enemy.getX() + enemy.getWidth()/2f, enemy.getY() + enemy.getHeight()/2f);
effects.add(currentPFX); effects.add(currentPFX);
} }
fe.collided(se); enemy.collided(ally);
se.collided(fe); ally.collided(enemy);
break; break;
} }
} }

View File

@ -23,6 +23,7 @@ public class Entity extends Actor implements Poolable {
protected boolean enemy; protected boolean enemy;
protected boolean simple = true; protected boolean simple = true;
protected boolean nonStnrd = false; protected boolean nonStnrd = false;
protected boolean move = true;
protected Rectangle hitbox; protected Rectangle hitbox;
protected Sprite sprite; protected Sprite sprite;
@ -30,10 +31,11 @@ public class Entity extends Actor implements Poolable {
protected Vector2 center; protected Vector2 center;
protected float angle; protected float angle;
protected float speed; protected float speed;
/** /**
* called by the entity frame and only once (when this object is created). * called by the entity frame and only once (when this object is created).
* Since your not supposed to actually use the constructor;
*/ */
protected void setup(EntityController ec, EntityFrame<?> ef) { protected void setup(EntityController ec, EntityFrame<?> ef) {
this.ec = ec; this.ec = ec;
@ -43,14 +45,12 @@ public class Entity extends Actor implements Poolable {
rotRatios = new Vector2(); rotRatios = new Vector2();
center = new Vector2(); center = new Vector2();
hitbox = new Rectangle(); hitbox = new Rectangle();
sprite = new Sprite();
sprite.setOriginCenter();
preInit(); preInit();
} }
public void preInit() { public void preInit() {
if (sprite.getTexture() == null) throw new NullPointerException("what, your not going to have a texture for your entity?"); if (sprite.getTexture() == null) throw new NullPointerException("what, your not going to have a texture for your entity?");
sprite.setOriginCenter();
} }
public void init(HashMap<String, Float> params) { public void init(HashMap<String, Float> params) {
@ -90,9 +90,11 @@ public class Entity extends Actor implements Poolable {
@Override @Override
public void act(float delta) { public void act(float delta) {
if (!nonStnrd) { if (!nonStnrd) {
rotRatios.set(MathUtils.cosDeg(angle), MathUtils.sinDeg(angle));
center.set(getX() + getWidth()/2f, getY() + getHeight()/2f); if (move) {
moveBy(rotRatios.x*speed*delta, rotRatios.y*speed*delta); move(delta, false);
}
if (simple) { if (simple) {
sprite.setPosition(getX(), getY()); sprite.setPosition(getX(), getY());
hitbox.setPosition(getX(), getY()); hitbox.setPosition(getX(), getY());
@ -101,6 +103,7 @@ public class Entity extends Actor implements Poolable {
} else { } else {
sprite.setCenter(center.x, center.y); sprite.setCenter(center.x, center.y);
hitbox.setCenter(center); hitbox.setCenter(center);
sprite.setOriginCenter();
sprite.setRotation(angle); sprite.setRotation(angle);
} }
@ -110,7 +113,6 @@ public class Entity extends Actor implements Poolable {
ef.recycleEntity(this); ef.recycleEntity(this);
} }
} }
} }
@Override @Override
@ -129,14 +131,32 @@ public class Entity extends Actor implements Poolable {
public boolean playCollideSFX() { public boolean playCollideSFX() {
return true; return true;
} }
public void move(float delta, boolean update) {
rotRatios.set(MathUtils.cosDeg(angle), MathUtils.sinDeg(angle));
moveBy(rotRatios.x*speed*delta, rotRatios.y*speed*delta);
center.set(getX() + getWidth()/2f, getY() + getHeight()/2f);
if (update) {
if (simple) {
sprite.setPosition(getX(), getY());
hitbox.setPosition(getX(), getY());
} else {
sprite.setCenter(center.x, center.y);
hitbox.setCenter(center);
sprite.setOriginCenter();
sprite.setRotation(angle);
}
}
}
@Override @Override
public void reset() { public void reset() {
rotRatios.set(0, 0); rotRatios.set(0, 0);
hitbox.set(0, 0, 0, 0); hitbox.set(0, 0, 0, 0);
sprite.setBounds(0, 0, 0, 0); sprite.setPosition(0, 0);
sprite.setRotation(0); sprite.setRotation(0);
sprite.setOrigin(0, 0);
setPosition(0, 0); setPosition(0, 0);
center.set(0, 0); center.set(0, 0);
angle = 0; angle = 0;

View File

@ -44,13 +44,13 @@ public class EntityController {
} }
private void setup() { private void setup() {
index.put(EntityIndex.VOID_CIRCLE, new EntityFrame<>(this, VoidCircle.class)); index.put(EntityIndex.VOID_CIRCLE, (voidCircle = new EntityFrame<>(this, VoidCircle.class)));
index.put(EntityIndex.PELLET, new EntityFrame<>(this, Pellet.class)); index.put(EntityIndex.PELLET, pellet = new EntityFrame<>(this, Pellet.class));
index.put(EntityIndex.SHARD, new EntityFrame<>(this, Shard.class)); index.put(EntityIndex.SHARD, shard = new EntityFrame<>(this, Shard.class));
index.put(EntityIndex.BAR, new EntityFrame<>(this, Bar.class)); index.put(EntityIndex.BAR, bar = new EntityFrame<>(this, Bar.class));
index.put(EntityIndex.FLAKE, new EntityFrame<>(this, Flake.class)); index.put(EntityIndex.FLAKE, flake = new EntityFrame<>(this, Flake.class));
index.put(EntityIndex.LASER, new EntityFrame<>(this, Laser.class)); index.put(EntityIndex.LASER, laser = new EntityFrame<>(this, Laser.class));
} }
public HashMap<EntityIndex, EntityFrame<? extends Entity>> getIndex() { public HashMap<EntityIndex, EntityFrame<? extends Entity>> getIndex() {

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.Sprite;
import zero1hd.polyjet.Main; import zero1hd.polyjet.Main;
import zero1hd.polyjet.entity.EntityIndex; import zero1hd.polyjet.entity.EntityIndex;
@ -16,7 +17,7 @@ public class Laser extends Entity {
@Override @Override
public void preInit() { public void preInit() {
sprite.setTexture(assets.get("laser.png", Texture.class)); sprite = new Sprite(assets.get("laser.png", Texture.class));
sfx = assets.get("laser.ogg", Sound.class); sfx = assets.get("laser.ogg", Sound.class);
setSize(0.25f, 2f); setSize(0.25f, 2f);
super.preInit(); super.preInit();
@ -46,11 +47,10 @@ public class Laser extends Entity {
@Override @Override
public void act(float delta) { public void act(float delta) {
toBack(); toBack();
super.act(delta);
if (getY() > Main.GAME_AREA_HEIGHT) { if (getY() > Main.GAME_AREA_HEIGHT) {
dead = true; dead = true;
} }
super.act(delta);
} }
@Override @Override
@ -61,6 +61,7 @@ public class Laser extends Entity {
@Override @Override
public void reset() { public void reset() {
dead = false; dead = false;
super.reset();
} }
@Override @Override

View File

@ -16,7 +16,6 @@ public class PolyJetEntity extends Entity {
private ParticleEffect thrust; private ParticleEffect thrust;
private Texture polyjet; private Texture polyjet;
private ParticleEffect teleportCloak; private ParticleEffect teleportCloak;
private Rectangle hitbox;
public boolean moveLeft, moveRight, moveUp, moveDown, teleporting, accelerate; public boolean moveLeft, moveRight, moveUp, moveDown, teleporting, accelerate;
private float speed, accel; private float speed, accel;
@ -97,4 +96,8 @@ public class PolyJetEntity extends Entity {
return false; return false;
} }
} }
public Rectangle getHitbox() {
return hitbox;
}
} }

View File

@ -3,6 +3,7 @@ package zero1hd.polyjet.entity.enemies;
import java.util.HashMap; import java.util.HashMap;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Rectangle;
import zero1hd.polyjet.Main; import zero1hd.polyjet.Main;
@ -15,7 +16,7 @@ public class Bar extends Entity {
@Override @Override
public void preInit() { public void preInit() {
setSize(8f, 0.5f); setSize(8f, 0.5f);
sprite.setTexture(assets.get("bar.png", Texture.class)); sprite = new Sprite(assets.get("bar.png", Texture.class));
enemy = true; enemy = true;
super.preInit(); super.preInit();
} }
@ -46,6 +47,7 @@ public class Bar extends Entity {
@Override @Override
public void reset() { public void reset() {
dead = false; dead = false;
super.reset();
} }
@Override @Override

View File

@ -4,24 +4,24 @@ import java.util.HashMap;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Rectangle;
import zero1hd.polyjet.Main; import zero1hd.polyjet.Main;
import zero1hd.polyjet.entity.EntityIndex; import zero1hd.polyjet.entity.EntityIndex;
import zero1hd.polyjet.entity.Entity; import zero1hd.polyjet.entity.Entity;
import zero1hd.polyjet.entity.EntityController;
public class Flake extends Entity { public class Flake extends Entity {
private float timer; private float timer;
private float totalTime; private float totalTime;
private Shard[] shards; private Shard[] shards;
private EntityController ec;
@Override @Override
public void preInit() { public void preInit() {
sprite.setTexture(assets.get("flake.png", Texture.class)); sprite = new Sprite(assets.get("flake.png", Texture.class));
simple = true; simple = true;
enemy = true; enemy = true;
move = false;
setSize(3f, 3f); setSize(3f, 3f);
super.preInit(); super.preInit();
} }
@ -33,13 +33,13 @@ public class Flake extends Entity {
shards[i].init(x, y, 360/shards.length*i, 0, 2); shards[i].init(x, y, 360/shards.length*i, 0, 2);
ec.getStage().addActor(shards[i]); ec.getStage().addActor(shards[i]);
} }
setSize(3f, 3f);
this.speed = rate; this.speed = rate;
this.timer = fuse; this.timer = fuse;
this.totalTime = fuse; this.totalTime = fuse;
this.angle = angle; this.angle = angle;
hitbox.setSize(getWidth(), getHeight()); hitbox.setSize(getWidth(), getHeight());
setPosition(x-center.x, y-center.y); setPosition(x-getWidth()/2f, y-getHeight()/2f);
} }
/** /**
@ -67,19 +67,27 @@ public class Flake extends Entity {
if (timer > 0) { if (timer > 0) {
timer -= delta; timer -= delta;
} }
move(delta, false);
System.out.println("---Start----");
System.out.println("Flake: " + center);
for (int i = 0; i < shards.length; i++) { for (int i = 0; i < shards.length; i++) {
shards[i].setPosition(center.x-shards[i].getCenter().x, center.y-shards[i].getCenter().y); shards[i].setPosition(center.x-shards[i].getWidth()/2f, center.y-shards[i].getWidth()/2f);
shards[i].move(delta, true);
System.out.println("Shard " + i + ": " + shards[i].getCenter());
System.out.println("Sprite Pos: " + shards[i].getHitZone());
} }
if (getX() > Main.GAME_AREA_WIDTH || getY() > Main.GAME_AREA_HEIGHT || getX() < 0-getWidth() || getY() < 0-getHeight()) { if (getX() > Main.GAME_AREA_WIDTH || getY() > Main.GAME_AREA_HEIGHT || getX() < 0-getWidth() || getY() < 0-getHeight()) {
timer = 0; timer = 0;
} }
super.act(delta); super.act(delta);
} }
@Override @Override
public void draw(Batch batch, float parentAlpha) { public void draw(Batch batch, float parentAlpha) {
sprite.setColor(0.1f,0.1f,0.1f,1f - timer/totalTime); sprite.setColor(0.1f,0.1f,0.1f, timer/totalTime);
super.draw(batch, parentAlpha); super.draw(batch, parentAlpha);
} }
@ -122,6 +130,7 @@ public class Flake extends Entity {
shards = null; shards = null;
hitbox.set(0, 0, 0, 0); hitbox.set(0, 0, 0, 0);
totalTime = 0; totalTime = 0;
super.reset();
} }
} }

View File

@ -3,6 +3,7 @@ package zero1hd.polyjet.entity.enemies;
import java.util.HashMap; import java.util.HashMap;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.utils.Pool.Poolable; import com.badlogic.gdx.utils.Pool.Poolable;
import zero1hd.polyjet.Main; import zero1hd.polyjet.Main;
@ -14,7 +15,7 @@ public class Pellet extends Entity implements Poolable {
@Override @Override
public void preInit() { public void preInit() {
sprite.setTexture(assets.get("pellet.png", Texture.class)); sprite = new Sprite(assets.get("pellet.png", Texture.class));
setSize(0.5f, 0.5f); setSize(0.5f, 0.5f);
super.preInit(); super.preInit();
} }
@ -54,6 +55,7 @@ public class Pellet extends Entity implements Poolable {
dead = true; dead = true;
break; break;
} }
super.collided(entity);
} }
@Override @Override
@ -69,6 +71,7 @@ public class Pellet extends Entity implements Poolable {
@Override @Override
public void reset() { public void reset() {
dead = false; dead = false;
super.reset();
} }
} }

View File

@ -2,7 +2,6 @@ package zero1hd.polyjet.entity.enemies;
import java.util.HashMap; import java.util.HashMap;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.Sprite;
@ -19,7 +18,8 @@ public class Shard extends Entity {
@Override @Override
public void preInit() { public void preInit() {
sprite = new Sprite(assets.get("shard.png", Texture.class)); sprite = new Sprite(assets.get("shard.png", Texture.class));
sprite.setSize(2f, 3f); setSize(2f, 2f);
sprite.setSize(3f, 2f);
simple = false; simple = false;
enemy = true; enemy = true;
super.preInit(); super.preInit();
@ -30,11 +30,9 @@ public class Shard extends Entity {
this.hp = hp; this.hp = hp;
maxHp = hp; maxHp = hp;
this.angle = angle; this.angle = angle;
sprite.setRotation(angle+90);
setSize(2f, 2f);
setPosition(x-(getWidth()/2f), y-(getHeight()/2f)); setPosition(x-(getWidth()/2f), y-(getHeight()/2f));
hitbox.setSize(getWidth(), getHeight()); hitbox.setSize(getWidth(), getHeight());
sprite.setOriginCenter();
} }
/** /**
@ -58,7 +56,6 @@ public class Shard extends Entity {
@Override @Override
public void act(float delta) { public void act(float delta) {
if (getX() > Main.GAME_AREA_WIDTH || getY() > Main.GAME_AREA_HEIGHT || getX() < 0-getWidth() || getY() < 0-getHeight()) { if (getX() > Main.GAME_AREA_WIDTH || getY() > Main.GAME_AREA_HEIGHT || getX() < 0-getWidth() || getY() < 0-getHeight()) {
hp = 0; hp = 0;
} }
@ -68,8 +65,6 @@ public class Shard extends Entity {
@Override @Override
public void draw(Batch batch, float parentAlpha) { public void draw(Batch batch, float parentAlpha) {
sprite.setColor(((float)hp/(float)maxHp), ((float)hp/(float)maxHp), ((float)hp/(float)maxHp), 0.5f); sprite.setColor(((float)hp/(float)maxHp), ((float)hp/(float)maxHp), ((float)hp/(float)maxHp), 0.5f);
sprite.draw(batch);
batch.setColor(Color.WHITE);
super.draw(batch, parentAlpha); super.draw(batch, parentAlpha);
} }

View File

@ -3,15 +3,13 @@ package zero1hd.polyjet.entity.enemies;
import java.util.HashMap; import java.util.HashMap;
import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.utils.Pool.Poolable;
import zero1hd.polyjet.entity.EntityIndex; import zero1hd.polyjet.entity.EntityIndex;
import zero1hd.polyjet.entity.Entity; import zero1hd.polyjet.entity.Entity;
public class VoidCircle extends Entity implements Poolable { public class VoidCircle extends Entity {
private float timer; private float timer;
private float endRadius; private float endRadius;
private float currentRadius; private float currentRadius;
@ -24,8 +22,9 @@ public class VoidCircle extends Entity implements Poolable {
@Override @Override
public void preInit() { public void preInit() {
sprite.setTexture(assets.get("void_circle.png", Texture.class)); sprite = new Sprite(assets.get("void_circle.png", Texture.class));
simple = false; simple = false;
enemy = true;
sound = assets.get("disintegrate.ogg", Sound.class); sound = assets.get("disintegrate.ogg", Sound.class);
super.preInit(); super.preInit();
} }
@ -84,12 +83,6 @@ public class VoidCircle extends Entity implements Poolable {
} }
@Override
public void draw(Batch batch, float parentAlpha) {
batch.setColor(Color.WHITE);
super.draw(batch, parentAlpha);
}
@Override @Override
public void reset() { public void reset() {
currentRadius = 0; currentRadius = 0;
@ -100,6 +93,7 @@ public class VoidCircle extends Entity implements Poolable {
done = false; done = false;
begin = false; begin = false;
setSize(0, 0); setSize(0, 0);
super.reset();
} }
public void growCurrentRadius(float radius) { public void growCurrentRadius(float radius) {

View File

@ -48,7 +48,7 @@ public class GamePlayArea extends Stage {
polyjet = new PolyJetEntity(assetManager, 25f, 25f, "standard"); polyjet = new PolyJetEntity(assetManager, 25f, 25f, "standard");
ec = new EntityController(assetManager, prefs, this); ec = new EntityController(assetManager, prefs, this);
collisionDetector = new CollisionDetector(ec.activeAllies, ec.activeEnemies, assetManager, prefs); collisionDetector = new CollisionDetector(ec.activeEnemies, ec.activeAllies, assetManager, prefs);
ec.activeAllies.add(polyjet); ec.activeAllies.add(polyjet);
addActor(polyjet); addActor(polyjet);
} }