Ejemplo n.º 1
0
        public void MainTimer_Tick(object sender, EventArgs e)
        {
            FramesInCurrentSecond++;
            p.TICK();

            for (int i = 0; i < StarCount; i++)
            {
                if (StarArray[i] == null)
                {
                    StarArray[i] = new Star(this);
                }

                if (StarArray[i].Sprite.Top > this.Height)
                {
                    StarArray[i].Dispose();
                    StarArray[i] = new Star(this);
                }

                StarArray[i].Move();
            }

            foreach (Enemy en in Conf.enemies)
            {
                en.TICK();
            }
            Conf.CollectEnemies();

            foreach (Player.Bullet bl in Conf.bullets)
            {
                bl.TICK();
            }
            Conf.CollectBullets();

            foreach (EnemyBullet bl in Conf.enemyBullets)
            {
                bl.TICK();
            }
            Conf.CollectEnemyBullets();

            foreach (Bonus bl in Conf.bonuses)
            {
                bl.TICK();
            }
            Conf.CollectBonuses();

            foreach (Bonus2 b in Conf.bonuses2)
            {
                b.TICK();
            }

            if (score > 50)
            {
                level = 4;
            }
            else if (score > 20)
            {
                level = 3;
            }
            else if (score > 10)
            {
                level = 2;
            }

            xGamePanel.TICK();

            Conf.DelayedAdd();
        }