Пример #1
0
 public void RemoveFireballs()
 {
     foreach (Fireball fireball in RemoveFireballList)
     {
         Fireballs.Remove(fireball);
     }
     RemoveFireballList.Clear();
 }
Пример #2
0
        public void Update(GameTime gametime)
        {
            // update scenery with time
            foreach (IScenery scenery in Sceneries)
            {
                scenery.Update(gametime);
            }
            // update background blocks
            for (int i = 0; i < Width; ++i)
            {
                for (int j = 0; j < Height; ++j)
                {
                    IBlock block = Blocks[i].SingleLevel[j];
                    if (block != null)
                    {
                        block.Update(gametime);
                    }
                }
            }
            foreach (IItem item in Items)
            {
                item.Update(gametime);
            }
            foreach (IEnemy enemy in Enemies)
            {
                enemy.Update(gametime);
            }
            foreach (FireHell fireHell in FireHells)
            {
                fireHell.Update(gametime);
            }
            foreach (IBoss boss in Bosses)
            {
                boss.Update(gametime);
            }
            foreach (Fireball fireball in Fireballs)
            {
                Fireballs.Remove(fireball);
                fireball.Update(gametime);
                if (fireball.IsRemove)
                {
                    RemoveFireballList.Add(fireball);
                }
            }
            foreach (FireShot fireShot in FireShots)
            {
                fireShot.Update(gametime);
            }

            foreach (ScoreObject score in Scores)
            {
                score.Update(gametime);
                if (score.IsRemoved)
                {
                    scoresRemoveList.Add(score);
                }
            }
            foreach (FlagStuff flagStuff in FlagStuffs)
            {
                flagStuff.Update(gametime);
            }
            RemoveFireballs();
            RemoveScoreObject();
            Mario.Update(gametime);
        }