public Entity CreateEntity(EntityTeam team, RectangleF[] possibleLocations, Grid.GridTrunk trunk) { var rand = (int)(possibleLocations.Length * Atlas.Rand); for (int i = 0; i < 16; i++) { Vector2 point = new Vector2(possibleLocations[rand].X + possibleLocations[rand].Width * Atlas.Rand, possibleLocations[rand].Y + possibleLocations[rand].Height * Atlas.Rand); if (trunk.CanFit(point, 24)) return new EntityTypes.VictoryComputerEntity(Atlas, team, point); } return null; }
public Entity CreateEntity(EntityTeam team, RectangleF[] possibleLocations, Grid.GridTrunk trunk) { var rand = (int)(possibleLocations.Length * Atlas.Rand); for (int i = 0; i < 16; i++ ) { Vector2 point = new Vector2(possibleLocations[rand].X + possibleLocations[rand].Width * Atlas.Rand, possibleLocations[rand].Y + possibleLocations[rand].Height * Atlas.Rand); if(trunk.CanFit(point, 16)) { if (team.TeamMembers.Length % 4 == 1) return new HunterEntity(Atlas, team, point); //spawn a hunter instead, roughly 3 seekers for every hunter return new SeekerEntity(Atlas, team, point); } } return null; }