예제 #1
0
        public override void Run(GameTime gameTime)
        {
            base.Run(gameTime);

            timePassed += gameTime.ElapsedGameTime.Milliseconds;
            spawnTime  += gameTime.ElapsedGameTime.Milliseconds;

            if (TriggerStatus == Trigger.Running)
            {
                if (spawnTime >= spawnDelay)
                {
                    float testWidth = level.LevelWidth - 2 * xPadding;

                    float xPos = xPadding + (float)(random.NextDouble() * (level.LevelWidth - 2 * xPadding));

                    if (singleEvent == null)
                    {
                        CreateCreature();
                        spawnTime = 0;
                    }
                    else
                    {
                        PointLevelEvent event_ = singleEvent;
                        event_.SetX(random.Next(level.LevelWidth));
                        event_.Run(gameTime);

                        spawnTime = 0;
                    }
                }
            }
        }
예제 #2
0
 public EvenSwarm(Game1 Game, PlayerVerticalShooter player, Sprite spriteSheet, Level level,
                  PointLevelEvent singleEvent, float startTime, float duration, float thickness)
     : base(Game, player, spriteSheet, level, singleEvent, startTime, duration)
 {
     this.thickness = thickness;
     SpawnDelay     = 1000 / (thickness / 10);
 }
예제 #3
0
 public GradientSwarm(Game1 Game, PlayerVerticalShooter player, Sprite spriteSheet, Level level,
                      PointLevelEvent singleEvent, float startTime, float duration, float peakPercentage, float minThickness, float maxThickness)
     : base(Game, player, spriteSheet, level, singleEvent, startTime, duration)
 {
     this.minThickness = minThickness / 10;
     this.maxThickness = maxThickness / 10;
     this.peakTime     = peakPercentage / 100 * duration;
 }
예제 #4
0
 protected Swarm(Game1 Game, PlayerVerticalShooter player, Sprite spriteSheet, Level level,
                 PointLevelEvent singleEvent, float startTime, float duration) :
     base(Game, player, spriteSheet, level, singleEvent, startTime, duration)
 {
     this.singleEvent = singleEvent;
 }
예제 #5
0
        protected LastingLevelEvent(Game1 Game, PlayerVerticalShooter player, Sprite spriteSheet, Level level, PointLevelEvent pointLevelEvent,
                                    float startTime, float duration)
            : base(Game, player, spriteSheet, level, pointLevelEvent.EnemyType, startTime)
        {
            this.duration = duration;

            hasDuration = true;
            timePassed  = 0;
        }