/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { RandomNumberGenerator.Initialize(); base.Initialize(); }
/// <summary> /// Gets a random firing delay between MIN_FIRING_DELAY and /// MIN_FIRING_DELY + FIRING_RATE_RANGE /// </summary> /// <returns>the random firing delay</returns> private int GetRandomFiringDelay() { return(GameConstants.BearMinFiringDelay + RandomNumberGenerator.Next(GameConstants.BearFiringRateRange)); }
/// <summary> /// Gets a random location using the given min and range /// </summary> /// <param name="min">the minimum</param> /// <param name="range">the range</param> /// <returns>the random location</returns> private int GetRandomLocation(int min, int range) { return(min + RandomNumberGenerator.Next(range)); }
/// <summary> /// Gets a random firing delay between MIN_FIRING_DELAY and /// MIN_FIRING_DELY + FIRING_RATE_RANGE /// </summary> /// <returns>the random firing delay</returns> private int GetRandomFiringDelay() { return(GameConstants.BEAR_MIN_FIRING_DELAY + RandomNumberGenerator.Next(GameConstants.BEAR_FIRING_RATE_RANGE)); }