Esempio n. 1
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        private void Start()
        {
            if (player == null)
            {
                player = new ship(this, ref shipModel);
                Components.Add(player);
                lastTickCount = System.Environment.TickCount;
            }

            rockCount = STARTMETEORCOUNT;
            player.PutinStartPosition();

            for (int i = 0; i < STARTMETEORCOUNT; i++)
            {
                Components.Add(new meteors(this, ref asteroidModel));
            }
        }
Esempio n. 2
0
        private void GameOver()
        {
            if (dead >= DEAD_COUNT)
            {
                if (highestscore < score)
                    highestscore = score;

                RemoveGame();
                backgroundTexture = gameoverTexture;
                gameover = true;
                player = null;
                backmusic.Pause();

            }
        }