Update() публичный Метод

public Update ( ) : void
Результат void
Пример #1
0
 public override void Update(GameTime gameTime, Player player, TileMap map)
 {
     animation.Update(gameTime, null);
     if ((rectangle.Intersects(player.rectangle)) & (isActive))
     {
         sound.PlaySound();
         isActive       = false;
         player.points += value;
     }
 }
Пример #2
0
        public override void Update(GameTime gameTime, Player player, TileMap map)
        {
            wasChecked = isChecked;
            if (isChecked)
            {
                animation.Update(gameTime, null);
            }

            if (rectangle.Intersects(player.rectangle))
            {
                isChecked = true;
            }
        }
Пример #3
0
 public override void Update(GameTime gameTime, Player player, TileMap map)
 {
     if (wasAccepted & Keyboard.GetState().IsKeyUp(Keys.Space))
     {
         isActive    = false;
         wasAccepted = false;
     }
     if ((Keyboard.GetState().IsKeyDown(Keys.Space)) & (isActive))
     {
         wasAccepted = true;
     }
     else
     {
         animatedTexture.Update(gameTime, null);
         CheckTrigger(player);
     }
 }
Пример #4
0
        public virtual void Update(GameTime gameTime, Player player, TileMap map, List <MovableItem> movableList)
        {
            if ((isAlive) & (deathTime <= 80))
            {
                FrictionCount();
                if (!canFly & isAlive & !isOnLadder)
                {
                    GravitySimulation();
                }
                IsOnObstracles(map);
                CheckEnviromentColision(map);
                CheckColisionWithMovables(movableList, map);
                UpdatePosition();

                if (attacking > 0)
                {
                    attacking--;
                }


                if (lifePoints <= 0)
                {
                    isAlive = false;
                    deathAnimation.UpdateRectangle(rectangle);
                    velocity = Vector2.Zero;
                }
            }
            else
            {
                GravitySimulation();
                CheckEnviromentColision(map);
                UpdatePosition();

                deathTime++;
                deathAnimation.Update(gameTime, null);
            }
            animatedTexture.Update(gameTime, this);
        }
Пример #5
0
 public override void Update(GameTime gameTime, Player player, TileMap map)
 {
     animation.Update(gameTime, player);
     base.Update(gameTime, player, map);
 }