changed flake texture. minor fixing of entity controller

This commit is contained in:
Harrison Deng 2017-06-04 14:08:52 -05:00
parent a9443b1acc
commit c416d9f1ea
12 changed files with 19 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 211 B

View File

@ -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;
}
}

View File

@ -112,7 +112,11 @@ public class EntityController {
}
public void free(Entity entity) {
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;
}

View File

@ -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());

View File

@ -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);