public Player(Vector2 origin, Texture2D texture) : base(origin, texture) { target = this; Health = 3; Heading = new Vector2(0, 1); }
public void acquireTarget(List<Civilian> civs) { target = civs.ElementAt(0); foreach (Civilian c in civs) { if ( distanceToCivilian(c) < distanceToCivilian(target) ) { target = c; } } if (distanceToCivilian(target) > Constants.TARGET_RANGE) { target = this; } }
private float distanceToCivilian(Civilian c) { return (this.Origin - c.Origin).Length(); }
public Player(Vector2 origin, Texture2D texture) : base(origin, texture) { target = this; }