Ejemplo n.º 1
0
        void Game_Deactivated(object sender, DeactivatedEventArgs e)
        {
            SettingsData data = new SettingsData();

            data.Highscore = highscore;
            data.SoundEnabled = soundEnabled;
            data.Difficulty = difficulty;
            data.GamesLaunched = gamesLaunched;
            data.GameIsReviewed = gameIsReviewed;

            data.Save();

            PhoneApplicationService.Current.State["gameState"] = gameState;
            SaveGameData();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            gameState = GameState.Menu;

            mazeWidth = 257;
            mazeHeight = 257;

            retryAdCreation = false;
            adTimeout = 0;

            #if DEBUG
            frameRate = 0;
            frameCounter = 0;
            elapsedTime = TimeSpan.Zero;

            numberOfSlowdowns = 0;
            #endif

            instructionsPage = 1;

            SettingsData data = new SettingsData();
            data.Load();

            highscore = data.Highscore;
            soundEnabled = data.SoundEnabled;
            difficulty = data.Difficulty;
            gamesLaunched = data.GamesLaunched;
            gameIsReviewed = data.GameIsReviewed;

            base.Initialize();
        }
Ejemplo n.º 3
0
        void Game_Closing(object sender, ClosingEventArgs e)
        {
            SettingsData data = new SettingsData();

            data.Highscore = highscore;
            data.SoundEnabled = soundEnabled;
            data.Difficulty = difficulty;
            data.GamesLaunched = gamesLaunched;
            data.GameIsReviewed = gameIsReviewed;

            data.Save();

            SaveGameData();
        }