Пример #1
0
        public override void Notify()
        {
            // Debug.WriteLine("Move Left");
            Ship pShip = ShipManager.GetCurrentShip();

            pShip.MoveLeft();
        }
Пример #2
0
        public override void Notify()
        {
            //Testing purposes
            //Debug.WriteLine("Move Left");
            Ship pShip = ShipMan.GetShip();

            pShip.MoveLeft();
        }
Пример #3
0
        public override void Notify()
        {
            this.debouceCount++;
            //debounceLimit is a static var in InputObserver.cs
            if (this.debouceCount % debounceLimit == 1)
            {
                //Debug.WriteLine("Moving Left");
            }
            Ship pShip = ShipMan.GetShip();

            pShip.MoveLeft();
        }
Пример #4
0
        /// <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);
        }
Пример #5
0
 public override void Update()
 {
     if (GameManager.GetGame().GetState() is GameActiveState)
     {
         Ship pShip = ShipManager.GetShip();
         if (pShip.x < 55.0f)
         {   // TODO: synch this up with actual LeftWall x placement.
             // Don't move
         }
         else
         {
             pShip.MoveLeft();
         }
     }
 }
Пример #6
0
        protected override void derivedUpdate(InputSubject pInputSubject)
        {
            Ship pShip = ShipManager.GetShip();

            pShip.MoveLeft();
        }
Пример #7
0
        public override void Notify()
        {
            Ship pShip = ShipMan.GetShip();

            pShip.MoveLeft();
        }