changed flake texture. minor fixing of entity controller
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 275 B After Width: | Height: | Size: 577 B |
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 658 B |
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 696 B |
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 993 B |
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 211 B |
@ -1,9 +1,15 @@
|
||||
package zero1hd.polyjet.entity;
|
||||
|
||||
public enum Entities {
|
||||
POLYJET, BAR, VOID_CIRCLE, SHARD, LASER, PELLET, FLAKE;
|
||||
POLYJET(false), BAR(true), VOID_CIRCLE(true), SHARD(true), LASER(false), PELLET(true), FLAKE(true);
|
||||
|
||||
public float x;
|
||||
public float y;
|
||||
public float velocity;
|
||||
private boolean enemy;
|
||||
|
||||
private Entities(boolean enemy) {
|
||||
this.enemy = enemy;
|
||||
}
|
||||
|
||||
public boolean isEnemy() {
|
||||
return enemy;
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,11 @@ public class EntityController {
|
||||
}
|
||||
|
||||
public void free(Entity entity) {
|
||||
activeEnemies.removeValue(entity, true);
|
||||
if (entity.getEntityType().isEnemy()) {
|
||||
activeEnemies.removeValue(entity, true);
|
||||
} else {
|
||||
activeAllies.removeValue(entity, true);
|
||||
}
|
||||
switch (entity.getEntityType()) {
|
||||
case VOID_CIRCLE:
|
||||
VoidCircle voidCircle = (VoidCircle) entity;
|
||||
@ -130,6 +134,7 @@ public class EntityController {
|
||||
pelletPool.free(pellet);
|
||||
break;
|
||||
case SHARD:
|
||||
System.out.println("freed");
|
||||
Shard shard = (Shard) entity;
|
||||
shard.remove();
|
||||
shardPool.free(shard);
|
||||
@ -143,6 +148,7 @@ public class EntityController {
|
||||
Flake flake = (Flake) entity;
|
||||
flake.remove();
|
||||
flakePool.free(flake);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -45,12 +45,9 @@ public class Flake extends Actor implements Poolable, Entity {
|
||||
timer -= delta;
|
||||
}
|
||||
moveBy(rot.x*delta*rate, rot.y*delta*rate);
|
||||
System.out.println("START");
|
||||
System.out.println(getY());
|
||||
for (int i = 0; i < shards.length; i++) {
|
||||
shards[i].setPosition(getX()+center.x-shards[i].getCenter().x, getY()+center.y-shards[i].getCenter().y);
|
||||
}
|
||||
System.out.println(shards[0].getY());
|
||||
|
||||
hitbox.setPosition(getX(), getY());
|
||||
|
||||
|
@ -47,11 +47,11 @@ public class Shard extends Actor implements Entity, Poolable {
|
||||
@Override
|
||||
public void reset() {
|
||||
hp = 0;
|
||||
maxHp = 0;
|
||||
setPosition(0, 0);
|
||||
angle.set(0, 0);
|
||||
center.set(0, 0);
|
||||
setSize(0, 0);
|
||||
maxHp = 0;
|
||||
hitbox.set(0, 0, 0, 0);
|
||||
setSize(0, 0);
|
||||
sprite.setRotation(0);
|
||||
@ -73,7 +73,7 @@ public class Shard extends Actor implements Entity, Poolable {
|
||||
public void draw(Batch batch, float parentAlpha) {
|
||||
sprite.setCenter(getX()+center.x, getY()+center.y);
|
||||
|
||||
sprite.setColor(1f, 0f, (float)hp/(float)maxHp, 1f);
|
||||
sprite.setColor((float)hp/(float)maxHp, 1f, 0.5f, 1f);
|
||||
sprite.draw(batch);
|
||||
batch.setColor(Color.WHITE);
|
||||
super.draw(batch, parentAlpha);
|
||||
|