protected override void Initialize()
        {
            StaticClassSerializer.Load(typeof(PlayerData), "data.bin");

            // Manage inputs like keyboard or gamepad
            Components.Add(new InputHandler(this));

            // Display FPS at the top left screen's corner
            Components.Add(new FrameRateCounter(this));

            _stateManager = new GameStateManager(this);
            Components.Add(_stateManager);

            // Screens
            TitleScreen             = new TitleScreen(this, _stateManager);
            DebugScreen             = new DebugScreen(this, _stateManager);
            PatternTestScreen       = new PatternTestScreen(this, _stateManager);
            GameConfigurationScreen = new GameConfigurationScreen(this, _stateManager);
            GameplayScreen          = new GameplayScreen(this, _stateManager);
            LeaderboardScreen       = new LeaderboardScreen(this, _stateManager);
            ImprovementScreen       = new ImprovementScreen(this, _stateManager);
            GameOverScreen          = new GameOverScreen(this, _stateManager);
            OptionsScreen           = new OptionsScreen(this, _stateManager);
            KeyboardInputsScreen    = new KeyboardInputsScreen(this, _stateManager);
            GamepadInputsScreen     = new GamepadInputsScreen(this, _stateManager);

            _stateManager.ChangeState(TitleScreen);

            ParticleManager = new ParticleManager <ParticleState>(1024 * 20, ParticleState.UpdateParticle);

            base.Initialize();
        }
        protected override void UnloadContent()
        {
            /*
             * if (Server != null)
             *  Server.client.Disconnect("Bye");
             */

            StaticClassSerializer.Save(typeof(PlayerInfo), "PlayerInfo.xml", false);
        }
Exemple #3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                instanceDisposer.Dispose();
                StaticClassSerializer.Save(typeof(PlayerData), "data.bin");
            }

            base.Dispose(disposing);
        }
        protected override void Initialize()
        {
            // We get all map files to store name + md5 checksum in a dictionary
            MapLoader.LoadMapFiles();

            // We load player info
            StaticClassSerializer.Load(typeof(PlayerInfo), "PlayerInfo.xml", false);

            // Volume
            MediaPlayer.Volume       = Config.MusicVolume;
            SoundEffect.MasterVolume = Config.SoundVolume;

            _timer = new Stopwatch();
            _timer.Start();

            base.Initialize();
        }
        protected override void Dispose(bool disposing)
        {
            TitleScreen.Dispose();
            GameConfigurationScreen.Dispose();
            GameplayScreen.Dispose();
            LeaderboardScreen.Dispose();
            ImprovementScreen.Dispose();
            GameOverScreen.Dispose();
            OptionsScreen.Dispose();
            KeyboardInputsScreen.Dispose();
            GamepadInputsScreen.Dispose();

            _stateManager.Dispose();
            SpriteBatch.Dispose();

            StaticClassSerializer.Save(typeof(PlayerData), "data.bin");

            base.Dispose(disposing);
        }
Exemple #6
0
        protected override void Initialize()
        {
            StaticClassSerializer.Load(typeof(PlayerData), "data.bin");

            base.Initialize();
        }