예제 #1
0
        public void Update()
        {
            if (!myClue && Mygame.World.clue1Note)
            {
                ItemList.Add(new FlowerClueClass(Mygame, new Vector2(4446, 364)));
                myClue = true;
            }
            foreach (IEnemy enemy in EnemyList)
            {
                enemy.Update();
            }
            foreach (IItem item in ItemList)
            {
                item.Update();
            }
            foreach (IBlock block in BlockList)
            {
                block.Update();
            }

            foreach (IFire fire in FireList)
            {
                fire.Update();
            }
            count++;
            Queue <IProjectile> tempQueue = new Queue <IProjectile>();

            while (ProjectileQueue.Count > 0)
            {
                IProjectile temp       = ProjectileQueue.Dequeue();
                bool        checkIfOut = temp.position.X <Mygame.camera.cameraPositionX ||
                                                          temp.position.X> Mygame.camera.cameraPositionX + 800 || temp.position.Y < 0 || temp.position.Y > 480;
                if ((temp.rectangle.Height == 0 && count == 10) || checkIfOut)
                {
                }
                else
                {
                    temp.Update();
                    tempQueue.Enqueue(temp);
                }
            }
            if (count == 10)
            {
                count = 0;
            }
            ProjectileQueue = tempQueue;

            foreach (IBackground background in BackgroundList)
            {
                background.Update();
            }

            CollisionDetector.Update(this);
            ECollisionDetector.Update(this);
            FBCollisionDetector.Update(this);
            ICollisionDetector.Update(this);
        }
예제 #2
0
        public void Update()
        {
            foreach (IEnemy enemy in EnemyList)
            {
                enemy.Update();
            }
            foreach (IBlock block in BlockList)
            {
                block.Update();
            }
            foreach (IItem item in ItemList)
            {
                item.Update();
            }
            foreach (IFire item in FireList)
            {
                item.Update();
            }
            count++;
            Queue <IProjectile> tempQueue = new Queue <IProjectile>();

            while (ProjectileQueue.Count > 0)
            {
                IProjectile temp       = ProjectileQueue.Dequeue();
                bool        checkIfOut = (temp.position.X <Mygame.camera.cameraPositionX ||
                                                           temp.position.X> Mygame.camera.cameraPositionX + 800 || temp.position.Y < 0 || temp.position.Y > 480);
                if ((temp.rectangle.Height == 0 && count == 10) || checkIfOut)
                {
                }
                else
                {
                    temp.Update();
                    tempQueue.Enqueue(temp);
                }
            }
            if (count == 10)
            {
                count = 0;
            }
            ProjectileQueue = tempQueue;

            foreach (IBackground background in BackgroundList)
            {
                background.Update();
            }
            BossPr.Update();
            CollisionDetector.Update(this);
            ECollisionDetector.Update(this);
            FBCollisionDetector.Update(this);
            ICollisionDetector.Update(this);
            BossPrincessCollisionDetector.Update(this);
        }
예제 #3
0
        public void Update()
        {
            foreach (IEnemy enemy in EnemyList)
            {
                enemy.Update();
            }
            foreach (IBlock block in BlockList)
            {
                block.Update();
            }
            foreach (IItem item in ItemList)
            {
                item.Update();
            }
            foreach (IFire fire in FireList)
            {
                fire.Update();
            }
            count++;
            Queue <IProjectile> tempQueue = new Queue <IProjectile>();

            while (ProjectileQueue.Count > 0)
            {
                IProjectile temp = ProjectileQueue.Dequeue();
                if (temp.mySprite is MarioFireBallBoomSprite && count == 50)
                {
                }
                else
                {
                    temp.Update();
                    tempQueue.Enqueue(temp);
                }
            }
            if (count == 50)
            {
                count = 0;
            }
            ProjectileQueue = tempQueue;

            foreach (IBackground background in BackgroundList)
            {
                background.Update();
            }
            CollisionDetector.Update(this);
            ECollisionDetector.Update(this);
            FBCollisionDetector.Update(this);
            ICollisionDetector.Update(this);
        }