Example #1
0
        void restart()
        {
            youLoseSound.Play();
            deterministicGame.currentLevel.gameRestart = false;

            graphics.PreferredBackBufferHeight = 600;
            graphics.PreferredBackBufferWidth  = 800;
            graphics.ApplyChanges();


            musicControl.Restart();


            // Make the game object.  The game is currently called 'DuckSlaughterGame'
            deterministicGame = new DuckSlaughterGame();
            deterministicGame.ResetGame(playerIdentifiers, playerIdentifiers[0]);
            deterministicGame.LoadContent(Content);
            deterministicGame.Initialize();

            // Debugging setup
            lastPressedKeys = new List <Keys>();
            activePlayer    = playerIdentifiers[0];
            paused          = false;
            gameStarted     = false;


            //Added
            isHost   = false;
            chatText = "";

            reader.Close();
            writer.Close();

            networkSession.Dispose();

            networkSession = null;

            reader        = new PacketReader();
            writer        = new PacketWriter();
            chatlines     = 0;
            isChatting    = false;
            mouseChange   = false;
            buttonPressed = false;
            others        = new player[4];
            update        = true;
            gameStarted   = false;

            inMenu = true;
            startS.Show();
            helpS.Hide();
            activeS      = startS;
            releasedKeys = new List <Keys>();
        }
Example #2
0
        // Constructor
        public Game06()
        {
            musicControl = new MusicControl();


            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Make the game object.  The game is currently called 'DuckSlaughterGame'.

            deterministicGame = new DuckSlaughterGame();

            // Debugging setup

            lastPressedKeys = new List <Keys>();
            activePlayer    = playerIdentifiers[0];
            paused          = false;
            gameStarted     = false;


            //Added
            Components.Add(new GamerServicesComponent(this));
            isHost        = false;
            chatText      = "";
            reader        = new PacketReader();
            writer        = new PacketWriter();
            chatlines     = 0;
            isChatting    = false;
            mouseChange   = false;
            buttonPressed = false;
            others        = new player[4];
            update        = true;

            inMenu       = true;
            releasedKeys = new List <Keys>();
        }