Jump to content

Animation only playing first frame


v33dub
 Share

Recommended Posts

Hey guys, hoping you can help me with this. My attack animation is only playing the first frame. Here's where I pull in the frames:

var swordDown = player.animations.add('swordDown', Phaser.Animation.generateFrameNames('swordDown', 1, 4), 10, true);

 

And here's where I try to play the animation in the update loop:

// Player attack functionality
    if(spaceKey.isDown) {
    	if(spaceKey.justPressed) {
    		player.animations.play('swordDown');
    	}
    }

 

The frames will play just fine if I set the isDown to one of the cursor keys, so I know my frames are coming in right. Any ideas? This is driving me batty.

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...