示例#1
0
        //This method usually spawns a well. It sometimes not spawning a well has 2 reasons:
        //#1: To add a little bit of randomness to the game.
        //#2: So the game screen doesn't get too cluttered. (If it doesn't find an empty space, it doesn't spawn)
        public void SpawnWell()
        {
            double xc = Random.NextDouble() * 5000.0;
            double yc = Random.NextDouble() * 5000.0;

            if (!NearOtherObject(xc, yc))
            {
                Well well = new Well(xc, yc);
                well.TicksLeft = WellDestabFreq + Random.Next(1001);
                StableWells.Add(well);
                GameObjects.Add(well);
            }
        }
示例#2
0
        //This method usually spawns a well. It sometimes not spawning a well has 2 reasons:
        //#1: To add a little bit of randomness to the game.
        //#2: So the game screen doesn't get too cluttered. (If it doesn't find an empty space, it doesn't spawn)
        public void SpawnWell()
        {
            double xc = Random.NextDouble() * 5000.0;
            double yc = Random.NextDouble() * 5000.0;

            if (!NearOtherObject(xc, yc))
            {
                Well well = new Well(xc, yc);
                well.TicksLeft = WellDestabFreq + Random.Next(1001);
                StableWells.Add(well);
                GameObjects.Add(well);
                UpdateAnimationEvent(this, new AnimationEventArgs(false, AnimationType.Stable, StableWells.Count, 0, 0));
                well.ShockWave = new Shockwave(this, well);
            }
        }