Update() public method

public Update ( ) : void
return void
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 public override void Update(GameTime gameTime, Player player, TileMap map)
 {
     animation.Update(gameTime, player);
     base.Update(gameTime, player, map);
 }