private static MevoPoint GetNewSpawn(MevoUniverse uni) { double radius = MevoUtils.Rand.NextDouble() * uni.SpawnRadius; double radian = MevoUtils.Deg2Rad(MevoUtils.Rand.Next(360)); MevoPoint pnt = new MevoPoint(); pnt.X = uni.CenterOfMass.X + (int)(radius * Math.Cos(radian)); pnt.Y = uni.CenterOfMass.Y + (int)(radius * Math.Sin(radian)); return(pnt); }
private MevoPoint GetSpawnPoint() { double radius = MevoUtils.Rand.NextDouble() * SpawnRadius; double radian = MevoUtils.Deg2Rad(MevoUtils.Rand.Next(360)); MevoPoint pnt = new MevoPoint(); pnt.X = CenterOfMass.X + (int)(radius * Math.Cos(radian)); pnt.Y = CenterOfMass.Y + (int)(radius * Math.Sin(radian)); return(pnt); }