Пример #1
0
        async private void ProcessCallback(String command, String param)
        {
            Console.WriteLine("Incoming callback from C++ : " + command);

            if (command.Equals("GAME_OVER"))
            {
                int score = m_d3dInterop.getScore();

                IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;

                int bestScore = 0;

                if (settings.Contains("BEST_SCORE"))
                {
                    bestScore = Convert.ToInt32(settings["BEST_SCORE"]);
                }

                if (score >= bestScore)
                {
                    if (settings.Contains("BEST_SCORE"))
                    {
                        settings.Remove("BEST_SCORE");
                    }
                    String bestScoreString = Convert.ToString(score);
                    settings.Add("BEST_SCORE", bestScoreString);
                    settings.Save();
                }

                m_d3dInterop.setBestScore(Convert.ToInt32(settings["BEST_SCORE"]));
            }
        }
Пример #2
0
        private void saveHighScore()
        {
            int highScore = m_d3dInterop.getScore();
            int highWave  = m_d3dInterop.getWave();

            SaveData.saveHighScoreForLevel(highScore, highWave, difficulty, levelIndex);
        }