// public void setColor(Color color){ this.color=color;} public Tank copy() { Tank tank = new Tank(client, world); tank.angle.set(angle); tank.speed = speed; tank.location.set(getLocation()); tank.speedToggle = speedToggle; tank.rotateToggle = rotateToggle; return tank; }
public double getDirection(Tank that) { Coordinate other = that.getLocation(); return Math.atan2(other.y() - location.y(), other.x() - location.x()); }
public double getDistance(Tank that) { Coordinate other = that.getLocation(); return Math.sqrt(Math.pow(other.x() - location.x(), 2) + Math.pow(other.x() - location.y(), 2)); }