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); }
private bool Keyboard_KeyPressed(MOIS.KeyEvent arg) { if (arg.key == MOIS.KeyCode.KC_SPACE) { this.characterController.Jump(); } return(true); }
private bool KeyPressed(MOIS.KeyEvent arg) { // stop if (arg.key == MOIS.KeyCode.KC_ESCAPE) { running = false; } return(true); }
/// <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); }
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); }
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); }
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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
private bool Keyboard_KeyPressed(MOIS.KeyEvent arg) { return(true); }
public virtual void injectKeyUp(MOIS.KeyEvent evt) { }
private bool Keyboard_KeyPressed(MOIS.KeyEvent arg) { return(ControllingObjType.KeyPressed(arg)); }
/// <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); }
public bool onKeyPressed(MOIS.KeyEvent arg) { Text = (char)arg.text; last = arg.key; return(true); }
private bool KeyReleased(MOIS.KeyEvent arg) { return(true); }
bool mKeyboard_KeyReleased(MOIS.KeyEvent arg) { return(true); }