Added ground unit factory support

This commit is contained in:
Anuken
2018-03-25 23:49:40 -04:00
parent d6cd197435
commit 203e4bc0a4
12 changed files with 396 additions and 305 deletions
@@ -37,8 +37,8 @@ public class TileEntity extends Entity{
public TileEntity init(Tile tile, boolean added){
this.tile = tile;
this.added = added;
x = tile.worldx();
y = tile.worldy();
x = tile.drawx();
y = tile.drawy();
health = tile.block().health;
@@ -24,6 +24,7 @@ public class FlyingUnitType extends UnitType {
speed = 0.2f;
maxVelocity = 4f;
drag = 0.01f;
isFlying = true;
}
@Override
@@ -54,6 +54,10 @@ public abstract class UnitType {
//TODO doesn't do anything
}
public boolean isFlying(){
return isFlying;
}
public void update(BaseUnit unit){
if(unit.hitTime > 0){
unit.hitTime -= Timers.delta();