Ejemplo n.º 1
0
        void timer_Tick(object sender, EventArgs e)
        {
            galaxy.Update();
            fleets.Update();

            SetRadius(currentPlanet);
            SetFace(currentPlanet);

            Enemy_AI();

            gameData.PlayerShips = galaxy.PlayerShips() + fleets.PlayerShips();
            gameData.EnemyShips  = galaxy.EnemyShips() + fleets.EnemyShips();

            if (galaxy.EnemyPlanets() == 0 && gameData.EnemyShips == 0)
            {
                timerGame.Stop();
                timerTime.Stop();
                RemoveFleets();

                silverlightControlGameOver.Winner = PlanetOwner.Player;
                ShowGameOver();
            }
            else if (galaxy.PlayerPlanets() == 0 && gameData.PlayerShips == 0)
            {
                timerGame.Stop();
                timerTime.Stop();
                RemoveFleets();

                silverlightControlGameOver.Winner = PlanetOwner.Enemy;
                ShowGameOver();
            }
        }