Exemplo n.º 1
0
        public override void Update(GameTime gameTime, Vector2 location)
        {
            if (Owner == null)
            {
                EnemyDelayTimer.Update(gameTime);
                if (EnemyDelayTimer.IsDone)
                {
                    EnemyDelayTimer.Reset();
                    EnemyIsReloading = !EnemyIsReloading;
                }
            }

            ShootDelayTimer.Update(gameTime);
            if (ShootDelayTimer.IsDone && !EnemyIsReloading)
            {
                ShootDelayTimer.Reset();
                Level.Instance.AddProjectile(eProjectile.MG2, location + RelativeLocation, ShootDir, Owner, MG2Idx, MGDrawColor, Tier);
                Level.Instance.AddProjectile(eProjectile.MG2, location + RelativeLocation2, ShootDir, Owner, MG2Idx, MGDrawColor, Tier);
                MG2Idx++;
                if (MG2Idx > 2)
                {
                    MG2Idx = 0;
                }
            }
        }
Exemplo n.º 2
0
 public override void Update(GameTime gameTime, Vector2 location)
 {
     ShootDelayTimer.Update(gameTime);
     if (ShootDelayTimer.IsDone)
     {
         ShootDelayTimer.Reset();
         Level.Instance.AddProjectile(eProjectile.Boom1Enemy, location + RelativeLocation, ShootDir, Owner, -1, Color.White, Tier);
     }
 }
 public override void Update(GameTime gameTime, Vector2 location)
 {
     ShootDelayTimer.Update(gameTime);
     if (ShootDelayTimer.IsDone)
     {
         ShootDelayTimer.Reset();
         Level.Instance.AddProjectile(eProjectile.Missile, location + RelativeLocation - new Vector2(11, 0), ShootDir, Owner, -1, Color.White, Tier);
         Level.Instance.AddProjectile(eProjectile.Missile, location + RelativeLocation + new Vector2(11, 0), ShootDir, Owner, -1, Color.White, Tier);
         if (Owner != null)
         {
             Engine.Instance.Audio.PlaySound(AudioConstants.RLaunch);
         }
     }
 }
Exemplo n.º 4
0
 public override void Update(GameTime gameTime, Vector2 location)
 {
     ShootDelayTimer.Update(gameTime);
     if (ShootDelayTimer.IsDone)
     {
         ShootDelayTimer.Reset();
         Vector2 absLoc = location + RelativeLocation;
         if (Owner == null)
         {
             Level.Instance.AddProjectile(eProjectile.Round, absLoc, Maths.GetMoveDir(absLoc, Level.Instance.GetNearestPlayer(absLoc).CenterLoc), Owner, -1, Color.White, Tier);
         }
         else
         {
             BaseEnemy e = Level.Instance.GetRandomEnemy();
             if (e != null)
             {
                 Level.Instance.AddProjectile(eProjectile.Round, absLoc, Maths.GetMoveDir(absLoc, new Vector2(e.Location.X - e.AABB.Width / 2, e.Location.Y + e.AABB.Height + 16)), Owner, -1, Color.White, Tier);
             }
         }
     }
 }