Exemplo n.º 1
0
        //Updates and calls DeleteBullets for all bullets blastwave
        private static void ManageBullets(GameTime time)
        {
            int loopControl = bullets.Count;

            for (int i = 0; i < loopControl; i++)
            {
                CollisionGrid.Commit(bullets[i]);
                bullets[i].Update(time);
            }
            loopControl = growers.Count;

            for (int i = 0; i < loopControl; i++)
            {
                growers[i].Update(time);
            }
            DeleteBullets(bullets, false);
            DeleteBullets(growers, true);

            for (int i = 0; i < blasts.Count; i++)
            {
                if (blasts[i].HalfDead)
                {
                    blasts.RemoveAt(i);
                }
            }
        }
Exemplo n.º 2
0
 public virtual void Update(bool trigger, float time)
 {
     CollisionGrid.Commit((Enemy)this);
     ScreenWrap();
     IsDead = CheckDeath();
     Behave(trigger, time);
     position += velocity;
 }
Exemplo n.º 3
0
        public override void Update(bool trigger, float time)
        {
            if (!FirstInChain)
            {
                CollisionGrid.Commit((Enemy)this);
            }
            else
            {
                CollisionLocation.X = position.X + (float)Math.Cos(angle) * Size;
                CollisionLocation.Y = position.Y + (float)Math.Sin(angle) * Size;
            }
            ScreenWrap();
            IsDead = CheckDeath();
            Behave(trigger, time);
            position += velocity;

            if (Child != null)
            {
                Child.Update(trigger, time);
            }
        }