public void PlayAnimation(Animation animation)
        {
            if (Animation == animation)
            {
                return;
            }

            this.animation = animation;
            this.frameIndex = 0;
            this.time = 0.0f;
        }
Ejemplo n.º 2
0
        public void LoadContent()
        {
            player = content.Load<Texture2D>("adsfasgawerhaejrak.fw");

            idleAnimation = new Animation(content.Load<Texture2D>("up"), 0.1f, true);

            int positionX = (windowWidth / 2) - (player.Width / 4);
            int positionY = (windowHeight / 2) - (player.Height / 4);
            playerPosition = new Vector2((float)positionX, (float)positionY);

            spritePlayer.PlayAnimation(idleAnimation);
        }
Ejemplo n.º 3
0
        public void LoadContent()
        {
            player = content.Load<Texture2D>("adsfasgawerhaejrak.fw");
            support = content.Load<Texture2D>("attack101");
            idleAnimation = new Animation(content.Load<Texture2D>("up"), 0.1f, true, 8);
            supportAnimation = new Animation(content.Load<Texture2D>("attack101"), 1000f, false, 6);

            int positionX = (windowWidth / 2) - (player.Width / 4);
            int positionY = (windowHeight / 2) - (player.Height / 4);
            playerPosition = new Vector2((float)positionX, (float)positionY);
            heroPosition = new Vector2((float)positionX + 150, (float)positionY - 100);
            spritePlayer.PlayAnimation(idleAnimation);
            spritePlayer1.PlayAnimation(supportAnimation);
        }