public void PlayAnimation(Animation animation)
 {
     if (Animation == animation)
     {
     return;
     }
     this.animation = animation;
     this.frameIndex = 0;
     this.time = 0.0f;
 }
        public void LoadContent()
        {
            support = content.Load<Texture2D>("support/luigi");

            idleAnimation = new Animation(support, 0.1f, true);

            int positionX = (Level.windowWidth / 3) - (support.Width / 2);
            int positionY = (Level.windowHeight / 2) - (support.Height / 2);
            suppPosition = new Vector2((float)positionX, (float)positionY);
            spritePlayer.PlayAnimation(idleAnimation);
        }
Exemplo n.º 3
0
        public void LoadContent()
        {
            player = content.Load<Texture2D>("herosprite/64566");
            attack = content.Load<Texture2D>("herosprite/64566-2");

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

            int positionX = (Level.windowWidth / 2) - (player.Width / 2);
            int positionY = (Level.windowHeight / 2) - (player.Height / 3);
            playerPosition = new Vector2((float)positionX, (float)positionY);
            spritePlayer.PlayAnimation(idleAnimation);
        }