Пример #1
0
 public override void Update(GameTime gameTime)
 {
     changeDirection.Update(gameTime);
     changeState.Update(gameTime);
     sword.Update(gameTime);
     if (runningRight)
     {
         facingRight = true;
     }
     else
     {
         facingRight = false;
     }
     if (facingRight)
     {
         effect = SpriteEffects.None;
     }
     if (!facingRight)
     {
         effect = SpriteEffects.FlipHorizontally;
     }
     SelectingState();
     AI();
     if (Keyboard.GetState().IsKeyDown(Keys.P) && shuri == null)
     {
         System.Console.WriteLine("SHOOT!");
         shuri = new Shuriken(rect.Center, player.Rect.Center);
     }
     if (shuri != null)
     {
         shuri.Update(gameTime);
     }
 }
Пример #2
0
 public override void Update(GameTime gameTime)
 {
     changeDirection.Update(gameTime);
     changeState.Update(gameTime);
     sword.Update(gameTime);
     if (runningRight) facingRight = true;
     else facingRight = false;
     if (facingRight) effect = SpriteEffects.None;
     if (!facingRight) effect = SpriteEffects.FlipHorizontally;
     SelectingState();
     AI();
     if (Keyboard.GetState().IsKeyDown(Keys.P) && shuri == null)
     {
         System.Console.WriteLine("SHOOT!");
         shuri = new Shuriken(rect.Center, player.Rect.Center);
     }
     if (shuri != null)
         shuri.Update(gameTime);
 }