Implemented sending of players to client (incomplete)

This commit is contained in:
Anuken
2017-12-30 23:06:43 -05:00
parent 7b1c8d5769
commit eecd0f6d02
10 changed files with 105 additions and 10 deletions
@@ -7,6 +7,7 @@ import com.badlogic.gdx.Input.Buttons;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.input.PlaceMode;
import io.anuke.mindustry.net.Syncable;
import io.anuke.mindustry.resource.Mech;
import io.anuke.mindustry.resource.Recipe;
import io.anuke.mindustry.resource.Weapon;
@@ -17,14 +18,16 @@ import io.anuke.ucore.entities.DestructibleEntity;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class Player extends DestructibleEntity{
public class Player extends DestructibleEntity implements Syncable{
private static final float speed = 1.1f;
private static final float dashSpeed = 1.8f;
public Weapon weapon;
public transient Weapon weapon;
public Mech mech = Mech.standard;
public float angle;
public transient int clientid;
public transient float breaktime = 0;
public transient Recipe recipe;
public transient int rotation;
@@ -122,4 +125,9 @@ public class Player extends DestructibleEntity{
this.angle = Mathf.lerpAngDelta(this.angle, angle, 0.1f);
}
}
@Override
public Player add(){
return add(Vars.control.playerGroup);
}
}
@@ -129,7 +129,7 @@ public class Enemy extends DestructibleEntity{
//no tile found
if(target == null){
target = Entities.getClosest(Entities.defaultGroup(), x, y, range, e -> e instanceof Player);
target = Entities.getClosest(Vars.control.playerGroup, x, y, range, e -> true);
}
}else if(nearCore){
target = Vars.control.getCore().entity;