Ejemplo n.º 1
0
        private void initalisePlayer1Controles()
        {
            mPlayer1ControllerConfig = new Input.ControlConfig();
            mPlayer1ControllerConfig.registerIsNownKey(Keys.A, mPlayer1.moveLeft);
            mPlayer1ControllerConfig.registerIsNownKey(Keys.D, mPlayer1.moveRight);
            mPlayer1ControllerConfig.registerIsNownKey(Keys.W, delegate()
            {
                mPlayer1.mShip.mShipParticles.Emitter.Enabled = true;
                mPlayer1.moveForward();
            });
            mPlayer1ControllerConfig.registerIsUpAndWasDown(Keys.W, delegate() { mPlayer1.mShip.pauseThrustSound(); mPlayer1.mShip.mShipParticles.Emitter.Enabled = false; });

            mPlayer1ControllerConfig.registerIsUpAndWasDown(Keys.D, mPlayer1.stall);
            mPlayer1ControllerConfig.registerIsUpAndWasDown(Keys.A, mPlayer1.stall);
            mPlayer1ControllerConfig.registerIsNownKey(Keys.F, mPlayer1.fire);
            mPlayer1ControllerConfig.registerIsNownKey(Keys.V, mPlayer1.altFire);

            mPlayer1ControllerConfig.registerIsUpAndWasDown(Keys.R, mPlayer1.reset);
        }
Ejemplo n.º 2
0
        private void initalisePlayer2Controles()
        {
            mPlayer2ControllerConfig = new Input.ControlConfig();
            mPlayer2ControllerConfig.registerIsNownKey(Keys.Left, mPlayer2.moveLeft);
            mPlayer2ControllerConfig.registerIsNownKey(Keys.Right, mPlayer2.moveRight);
            mPlayer2ControllerConfig.registerIsNownKey(Keys.Up, delegate()
            {
                mPlayer2.mShip.mShipParticles.Emitter.Enabled = true;
                mPlayer2.moveForward();
                //mPlayer2.mShip.playThrustSound();
            });

            mPlayer2ControllerConfig.registerIsUpAndWasDown(Keys.Up, delegate() { mPlayer2.mShip.pauseThrustSound(); mPlayer2.mShip.mShipParticles.Emitter.Enabled = false; });
            mPlayer2ControllerConfig.registerIsUpAndWasDown(Keys.Right, mPlayer2.stall);
            mPlayer2ControllerConfig.registerIsUpAndWasDown(Keys.Left, mPlayer2.stall);
            //mPlayer2ControllerConfig.registerIsUpAndWasDown(Keys.RightShift, mPlayer2.fire);
            mPlayer2ControllerConfig.registerIsNownKey(Keys.RightShift, mPlayer2.fire);
            mPlayer1ControllerConfig.registerIsNownKey(Keys.RightControl, mPlayer2.altFire);

            mPlayer2ControllerConfig.registerIsUpAndWasDown(Keys.R, mPlayer2.reset);
        }