public override void Notify() { //Debug.WriteLine("Move Right"); Ship pShip = ShipMan.GetShip(); pShip.MoveRight(); }
public override void Notify() { //Debug.WriteLine("Move Right"); //move the ship to the right Ship pShip = ShipManager.GetCurrentShip(); pShip.MoveRight(); }
public override void Notify() { this.debouceCount++; //debounceLimit is a static var in InputObserver.cs if (this.debouceCount % debounceLimit == 1) { //Debug.WriteLine("Moving Right"); } Ship pShip = ShipMan.GetShip(); pShip.MoveRight(); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (!IsActive) { return; } if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } /* Controllers */ KeyboardState newKeyboardState = Keyboard.GetState(); MouseState newMouseState = Mouse.GetState(); /* Process mouse move */ if (_oldMouseState.X != newMouseState.X) { if (newMouseState.X >= 0 || newMouseState.X < _screenWidth) { _ship.MoveTo(newMouseState.X); } } /* Process left-click */ if (newMouseState.LeftButton == ButtonState.Released && _oldMouseState.LeftButton == ButtonState.Pressed && _readyToShoot) { //TODO /* Process keyboard events */ if (newKeyboardState.IsKeyDown(Keys.Left)) { _ship.MoveLeft(); } } if (newKeyboardState.IsKeyDown(Keys.Right)) { _ship.MoveRight(); } if (_oldKeyboardState.IsKeyUp(Keys.Space) && newKeyboardState.IsKeyDown(Keys.Space) && _readyToShoot) { //TODO _oldMouseState = newMouseState; // this saves the old state } _oldKeyboardState = newKeyboardState; base.Update(gameTime); }
public override void Update() { if (GameManager.GetGame().GetState() is GameActiveState) { Ship pShip = ShipManager.GetShip(); if (pShip.x > 830.0f) { // TODO: synch this up with actual RighttWall x placement. // Don't move } else { pShip.MoveRight(); } } }
protected override void derivedUpdate(InputSubject pInputSubject) { Ship pShip = ShipManager.GetShip(); pShip.MoveRight(); }
public override void Notify() { Ship pShip = ShipMan.GetShip(); pShip.MoveRight(); }