示例#1
0
        public bool OnKeyPressed(MOIS.KeyEvent arg)
        {
            switch (arg.key)
            {
            case MOIS.KeyCode.KC_SPACE:
            {
                Tutorial.shoot = true;
                break;         // For shooting!
            }

            case MOIS.KeyCode.KC_E:
            {
                //Tutorial.reload = true;
                break;         // Reloading
            }

            //case MOIS.KeyCode.KC_LSHIFT:
            //    {
            //        Tutorial.shift = true;
            //        break;
            //    }
            case MOIS.KeyCode.KC_ESCAPE:
            {
                return(false);
            }
            }
            return(true);
        }
示例#2
0
        private bool Keyboard_KeyPressed(MOIS.KeyEvent arg)
        {
            if (arg.key == MOIS.KeyCode.KC_SPACE)
            {
                this.characterController.Jump();
            }

            return(true);
        }
示例#3
0
文件: App.cs 项目: RainsSoft/ogreflow
        private bool KeyPressed(MOIS.KeyEvent arg)
        {
            // stop
            if (arg.key == MOIS.KeyCode.KC_ESCAPE)
            {
                running = false;
            }

            return(true);
        }
示例#4
0
        /// <summary>
        /// Processes input from keyboard (MusicPlayer control, Game pause, save or exit).
        /// </summary>
        /// <param name="evt">The evt.</param>
        /// <returns>
        /// Returns always true.
        /// </returns>
        protected override bool OnKeyPressed(MOIS.KeyEvent evt)
        {
            base.OnKeyPressed(evt);
            switch (evt.key)
            {
            case MOIS.KeyCode.KC_RETURN:
                if (Game.Initialized)
                {
                    Game.Paused = !Game.Paused;
                }
                break;

            case MOIS.KeyCode.KC_I:
                Game.IGameSoundPlayer.VolumeUp();
                break;

            case MOIS.KeyCode.KC_K:
                Game.IGameSoundPlayer.VolumeDown();
                break;

            case MOIS.KeyCode.KC_N:
                Game.IGameSoundPlayer.PlayNextSong();
                break;

            case MOIS.KeyCode.KC_M:
                Game.IGameSoundPlayer.Pause();
                break;

            case MOIS.KeyCode.KC_B:
                Game.IGameSoundPlayer.ShowCurrentlyPlayingSong();
                break;

            case MOIS.KeyCode.KC_R:
                RestartCamera();
                break;

            case MOIS.KeyCode.KC_ESCAPE:
                // Close the program.
                myGame.Quit();
                break;

            case MOIS.KeyCode.KC_F5:
                Game.Save("QuickSave.save");
                break;
            }
            return(true);
        }
示例#5
0
 bool mKeyboard_KeyPressed(MOIS.KeyEvent arg)
 {
     if (arg.key == MOIS.KeyCode.KC_ESCAPE)
     {
         if (!this.isEscapeMenuOpened)
         {
             this.BuildEscapeMenu();
         }
         else
         {
             GameManager.Instance.trayMgr.destroyAllWidgets();
             this.serverpanel        = GameManager.Instance.trayMgr.createParamsPanel(TrayLocation.TL_CENTER, "serverpanel", 400f, this.serverState);
             this.isEscapeMenuOpened = false;
         }
     }
     return(true);
 }
示例#6
0
        private bool Keyboard_KeyPressed(MOIS.KeyEvent arg)
        {
            switch (arg.key)
            {
            case MOIS.KeyCode.KC_W:
                break;

            case MOIS.KeyCode.KC_A:
                break;

            case MOIS.KeyCode.KC_S:
                break;

            case MOIS.KeyCode.KC_D:
                break;
            }
            return(true);
        }
示例#7
0
        bool inputKeyboard_KeyPressed(MOIS.KeyEvent e)
        {
            switch (e.key)
            {
            case MOIS.KeyCode.KC_F6:
                switch (camera.PolygonMode)
                {
                case PolygonMode.PM_POINTS:
                    camera.PolygonMode = PolygonMode.PM_SOLID;
                    break;

                case PolygonMode.PM_SOLID:
                    camera.PolygonMode = PolygonMode.PM_WIREFRAME;
                    break;

                case PolygonMode.PM_WIREFRAME:
                    camera.PolygonMode = PolygonMode.PM_POINTS;
                    break;
                }
                break;

            case MOIS.KeyCode.KC_F7:
                areShadowsEnabled = !areShadowsEnabled;
                if (areShadowsEnabled)
                {
                    sceneMgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_MODULATIVE;
                }
                else
                {
                    sceneMgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_NONE;
                }
                break;

            case MOIS.KeyCode.KC_F8:
                sceneMgr.ShowBoundingBoxes = !sceneMgr.ShowBoundingBoxes;
                break;

            case MOIS.KeyCode.KC_SYSRQ:
                TakeScreenshot();
                break;
            }
            return(true);
        }
示例#8
0
        /// <summary>
        /// Buffered key listener
        /// </summary>
        /// <param name="arg">A keyboard event</param>
        /// <returns></returns>
        private bool OnKeyPressed(MOIS.KeyEvent arg)
        {
            switch (arg.key)
            {
            case MOIS.KeyCode.KC_SPACE:
            {
                break;
            }

            case MOIS.KeyCode.KC_E:
            {
                break;
            }

            case MOIS.KeyCode.KC_ESCAPE:
            {
                return(false);
            }
            }
            return(true);
        }
示例#9
0
        /// <summary>
        /// Buffered key listener
        /// </summary>
        /// <param name="arg">A keyboard event</param>
        /// <returns></returns>
        private bool OnKeyPressed(MOIS.KeyEvent arg)
        {
            switch (arg.key)
            {
            //case MOIS.KeyCode.KC_SPACE:
            //    {   //You should use the spacebar to shoot
            //        playerController.Shoot = true;
            //        break;
            //    }
            case MOIS.KeyCode.KC_E:
            {           //shoot and the E key to swap weapons.
                playerController.SwapGun = true;
                break;
            }

            case MOIS.KeyCode.KC_ESCAPE:
            {
                return(false);          //exit game
            }
            }
            return(true);
        }
示例#10
0
        /// <summary>
        /// Buffered key listener
        /// </summary>
        /// <param name="arg">A keyboard event</param>
        /// <returns></returns>
        private bool OnKeyPressed(MOIS.KeyEvent arg)
        {
            switch (arg.key)
            {
            case MOIS.KeyCode.KC_SPACE:
            {
                playerController.Shoot = true;
                break;
            }

            case MOIS.KeyCode.KC_E:
            {
                playerController.ChangeGun = true;
                break;
            }

            case MOIS.KeyCode.KC_ESCAPE:
            {
                return(false);
            }
            }
            return(true);
        }
示例#11
0
        /// <summary>
        /// Buffered key listener
        /// </summary>
        /// <param name="arg">A keyboard event</param>
        /// <returns></returns>
        private bool OnKeyPressed(MOIS.KeyEvent arg)
        {
            switch (arg.key)
            {
            case MOIS.KeyCode.KC_SPACE:
            {
                controller.Shoot = true;
                break;
            }

            case MOIS.KeyCode.KC_E:
            {
                controller.SwapGun = true;
                break;
            }

            case MOIS.KeyCode.KC_Q:
            {
                controller.Reload = true;
                return(false);
            }
            }
            return(true);
        }
示例#12
0
 private bool Keyboard_KeyPressed(MOIS.KeyEvent arg)
 {
     return(true);
 }
示例#13
0
 public virtual void injectKeyUp(MOIS.KeyEvent evt)
 {
 }
示例#14
0
 private bool Keyboard_KeyPressed(MOIS.KeyEvent arg)
 {
     return(ControllingObjType.KeyPressed(arg));
 }
示例#15
0
        /// <summary>
        /// Function that handles tasks that trigger when a key is pressed.
        /// </summary>
        /// <param name="e">Data passed by the event handler that calls the function.</param>
        /// <returns></returns>
        public bool KeyPressed(MOIS.KeyEvent e)
        {
            switch (e.key)
            {
            case MOIS.KeyCode.KC_LEFT:
            case MOIS.KeyCode.KC_A:
                position--;
                if (position < -1)
                {
                    position = -1;
                }
                break;

            case MOIS.KeyCode.KC_RIGHT:
            case MOIS.KeyCode.KC_D:
                position++;
                if (position > 1)
                {
                    position = 1;
                }
                break;

            case MOIS.KeyCode.KC_SPACE:
                switch (position)
                {
                case -1:
                    running = false;
                    break;

                case 0:
                    if (soundEntity != null)
                    {
                        if (soundEntity.IsPlaying())
                        {
                            soundEntity.Stop();
                        }
                        else
                        {
                            soundEntity.Play();
                        }
                        break;
                    }

                    soundEntity = smgr.CreateSoundEntity("Assets/Sounds/DrumMono.ogg", mgr.GetSceneNode("Drum"), "Drum", false, false);
                    soundEntity.SetReferenceDistance(.5f);
                    soundEntity.SetMaxDistance(5);
                    soundEntity.Play();
                    break;

                case 1:
                    if (ambientSound != null)
                    {
                        if (ambientSound.IsPlaying())
                        {
                            ambientSound.Stop();
                        }
                        else
                        {
                            ambientSound.Play();
                        }
                        break;
                    }
                    ambientSound = smgr.CreateAmbientSound("Assets/Sounds/Tune.ogg", "Tune", false, false);
                    ambientSound.Play();
                    break;
                }
                break;

            case MOIS.KeyCode.KC_ESCAPE:
                running = false;
                break;
            }

            return(true);
        }
示例#16
0
 public bool onKeyPressed(MOIS.KeyEvent arg)
 {
     Text = (char)arg.text;
     last = arg.key;
     return(true);
 }
示例#17
0
文件: App.cs 项目: RainsSoft/ogreflow
 private bool KeyReleased(MOIS.KeyEvent arg)
 {
     return(true);
 }
示例#18
0
 bool mKeyboard_KeyReleased(MOIS.KeyEvent arg)
 {
     return(true);
 }