private void generatePlanet() { // Random radius float r = GameMath.Clamp(10, 80, (float)GlobalRandom.NormalDouble(45, 10)); // y-coordinate float y = 0; do { y = (float)GlobalRandom.NextDouble(-360 + r, 360 - r); } while (!this.checkPosition(y, r)); this.environment.AddPlanet(this.selectFactory(), new Vector2(640 + SideBuffer + r + this.environment.Offset, y), r); }