continued work on flake entityy
This commit is contained in:
@@ -6,7 +6,6 @@ import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
|
||||
|
||||
|
@@ -1,12 +1,14 @@
|
||||
package zero1hd.polyjet.entity.enemies;
|
||||
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import com.badlogic.gdx.utils.Pool.Poolable;
|
||||
|
||||
import zero1hd.polyjet.Polyjet;
|
||||
import zero1hd.polyjet.entity.Entities;
|
||||
import zero1hd.polyjet.entity.Entity;
|
||||
|
||||
@@ -35,6 +37,7 @@ public class Flake extends Actor implements Poolable, Entity {
|
||||
hitbox.setSize(getWidth(), getHeight());
|
||||
center.set(getWidth()/2f, getHeight()/2f);
|
||||
rot.set(MathUtils.sinDeg(angle), MathUtils.cosDeg(angle));
|
||||
debug();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,13 +49,24 @@ public class Flake extends Actor implements Poolable, Entity {
|
||||
}
|
||||
|
||||
for (int i = 0; i < shards.length; i++) {
|
||||
shards[i].debug();
|
||||
shards[i].setPosition(getX()+center.x-shards[i].getCenter().x, getY()+center.y-shards[i].getCenter().y);
|
||||
}
|
||||
|
||||
hitbox.setPosition(getX(), getY());
|
||||
|
||||
if (getX() > Polyjet.GAME_AREA_WIDTH || getY() > Polyjet.GAME_AREA_HEIGHT || getX() < 0-getWidth() || getY() < 0-getHeight()) {
|
||||
timer = 0;
|
||||
}
|
||||
super.act(delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Batch batch, float parentAlpha) {
|
||||
batch.draw(texture, getX(), getY());
|
||||
super.draw(batch, parentAlpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collided(Entity entity) {
|
||||
}
|
||||
@@ -89,6 +103,7 @@ public class Flake extends Actor implements Poolable, Entity {
|
||||
setSize(0, 0);
|
||||
center.set(0, 0);
|
||||
rot.set(0, 0);
|
||||
System.out.println("iscleaned");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user