diff --git a/core/src/zero1hd/polyjet/entity/enemies/Flake.java b/core/src/zero1hd/polyjet/entity/enemies/Flake.java index 60221b5..b673c1a 100755 --- a/core/src/zero1hd/polyjet/entity/enemies/Flake.java +++ b/core/src/zero1hd/polyjet/entity/enemies/Flake.java @@ -41,15 +41,17 @@ public class Flake extends Actor implements Poolable, Entity { @Override public void act(float delta) { - if (timer > 0) { 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()); if (getX() > Polyjet.GAME_AREA_WIDTH || getY() > Polyjet.GAME_AREA_HEIGHT || getX() < 0-getWidth() || getY() < 0-getHeight()) { diff --git a/core/src/zero1hd/polyjet/entity/enemies/Shard.java b/core/src/zero1hd/polyjet/entity/enemies/Shard.java index 187b151..07c8075 100755 --- a/core/src/zero1hd/polyjet/entity/enemies/Shard.java +++ b/core/src/zero1hd/polyjet/entity/enemies/Shard.java @@ -61,7 +61,6 @@ public class Shard extends Actor implements Entity, Poolable { public void act(float delta) { moveBy(angle.x*delta*rate, angle.y*rate*delta); hitbox.setPosition(getX(), getY()); - sprite.setCenter(getX()+center.x, getY()+center.y); if (getX() > Polyjet.GAME_AREA_WIDTH || getY() > Polyjet.GAME_AREA_HEIGHT || getX() < 0-getWidth() || getY() < 0-getHeight()) { hp = 0; @@ -72,6 +71,8 @@ public class Shard extends Actor implements Entity, Poolable { @Override 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.draw(batch); batch.setColor(Color.WHITE); diff --git a/core/src/zero1hd/polyjet/ui/windows/SpawnerWindow.java b/core/src/zero1hd/polyjet/ui/windows/SpawnerWindow.java index ea6628c..41da8ad 100755 --- a/core/src/zero1hd/polyjet/ui/windows/SpawnerWindow.java +++ b/core/src/zero1hd/polyjet/ui/windows/SpawnerWindow.java @@ -95,16 +95,15 @@ public class SpawnerWindow extends Window { stage.addActor(bar); break; case FLAKE: + Flake flake = (Flake) entity; Shard[] shards = new Shard[(int) mod4.getValue()]; for (int i = 0; i < shards.length; i++) { shards[i] = (Shard) ec.retrieveEntity(Entities.SHARD); - shards[i].init(coords.x, coords.y, 360f/shards.length*i, 0f, (int) mod3.getValue()); + shards[i].init(coords.x, coords.y, 360f/shards.length*i, 0f, (int) 2); stage.addActor(shards[i]); } - - Flake flake = (Flake) entity; - flake.init(coords.x, coords.y, mod1.getValue(), mod3.getValue(), mod2.getValue()/mod2.getMaxValue()*360f, shards); stage.addActor(flake); + flake.init(coords.x, coords.y, mod1.getValue(), mod3.getValue(), mod2.getValue()/mod2.getMaxValue()*360f, shards); default: break; }