began working on hit detection system
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package zero1hd.polyjet.entity;
|
||||
|
||||
public enum Entities {
|
||||
Bar_Beat, Void_Circle;
|
||||
BAR_BEAT, VOID_CIRCLE, SHARDS;
|
||||
|
||||
public float x;
|
||||
public float y;
|
||||
|
52
core/src/zero1hd/polyjet/entity/Entity.java
Normal file
52
core/src/zero1hd/polyjet/entity/Entity.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package zero1hd.polyjet.entity;
|
||||
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
|
||||
public class Entity extends Actor {
|
||||
private Rectangle box;
|
||||
|
||||
public Entity() {
|
||||
box = new Rectangle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeight(float height) {
|
||||
box.height = height;
|
||||
super.setHeight(height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWidth(float width) {
|
||||
box.width = width;
|
||||
super.setWidth(width);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(float width, float height) {
|
||||
box.setSize(width, height);
|
||||
super.setSize(width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setX(float x) {
|
||||
box.setX(x);
|
||||
super.setX(x);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setY(float y) {
|
||||
box.setY(y);
|
||||
super.setY(y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPosition(float x, float y) {
|
||||
box.setPosition(x, y);
|
||||
super.setPosition(x, y);
|
||||
}
|
||||
|
||||
public Rectangle getBox() {
|
||||
return box;
|
||||
}
|
||||
}
|
@@ -8,7 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.actions.Actions;
|
||||
|
||||
import zero1hd.polyjet.Polyjet;
|
||||
|
||||
public class PolyJetEntity extends Actor {
|
||||
public class PolyJetEntity extends Entity {
|
||||
|
||||
private ParticleEffect thrust;
|
||||
private Texture polyjet;
|
||||
@@ -16,8 +16,8 @@ public class PolyJetEntity extends Actor {
|
||||
|
||||
|
||||
public boolean moveLeft, moveRight, moveUp, moveDown, teleporting;
|
||||
private int rate;
|
||||
public PolyJetEntity(Polyjet core, int rate, String jet) {
|
||||
private float rate;
|
||||
public PolyJetEntity(Polyjet core, float rate, String jet) {
|
||||
this.rate = rate;
|
||||
|
||||
setSize(1.5f, 1.5f);
|
||||
@@ -63,6 +63,5 @@ public class PolyJetEntity extends Actor {
|
||||
thrust.draw(batch);
|
||||
batch.draw(polyjet, getX(), getY(), getWidth(), getHeight());
|
||||
super.draw(batch, parentAlpha);
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user