Update() public method

public Update ( ) : void
return 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
ファイル: Sprite.cs プロジェクト: s218156/TheGame
        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
ファイル: Tourch.cs プロジェクト: s218156/TheGame
 public override void Update(GameTime gameTime, Player player, TileMap map)
 {
     animation.Update(gameTime, player);
     base.Update(gameTime, player, map);
 }