Example #1
0
 private Vector2 PositionOf(Entity entity)
 {
     Vector2 position = transform.position;
     return position + entity.DistanceTo(position) * entity.DirectionFrom(position);
 }
Example #2
0
 private static double scoreEating(Entity currentChip, Entity entity, Entity[] myChips)
 {
     var score = Math.Pow(currentChip.Radius + entity.Radius, 2) - Math.Pow(currentChip.Radius, 2);
     if (entity.Player == currentChip.Player)
         score -= Math.Pow(entity.Radius, 2);
     return score / entity.DistanceTo(currentChip);
 }