TapTitan_DeanoDan.Hero.Update C# (CSharp) Method

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void
        public void Update(GameTime gameTime)
        {
            if(level.mouseState.LeftButton == ButtonState.Pressed && level.oldMouseState.LeftButton == Microsoft.Xna.Framework.Input.ButtonState.Released)
            {
                player = content.Load<Texture2D>("HeroSprite/Goku3");

                idleAnimation = new Animation(player, 0.1f, true, 6);

                int positionX = (Level.windowWidth / 2) - (idleAnimation.FrameWidth / 4);
                int positionY = (Level.windowHeight / 2) - (idleAnimation.FrameHeight / 4) - 80;
                playerPosition = new Vector2((float)positionX, (float)positionY);
                idleAnimation = new Animation(player, 0.1f, false, 6);

                spritePlayer.PlayAnimation(idleAnimation);
            }
        }