8bitxd Posted June 11, 2017 Share Posted June 11, 2017 Why does Phaser.Sprite.play take in a framerate as a variable, separate from the game's actual framerate? I am trying to load a spritesheet of a walking animation, and it run as I hold an arrow key, but I'm confused why the playing of the animation would require a framerate to be set, separate from how fast the game itself is running? Wouldn't this result in strange differences when viewing the animation, if the engine happens to run below a certain framerate? To load a walking sprite animation, should I be using the `.play` method? Should I instead be ticking the frames myself in the game loop? Link to comment Share on other sites More sharing options...
samme Posted June 12, 2017 Share Posted June 12, 2017 Those frames are the frames (cells) of the spritesheet. See examples/v2/animation/animation-events. The mummy spritesheet has 18 frames and is played at 10 frames per second, so it loops every 1.8 seconds. Link to comment Share on other sites More sharing options...
Skeptron Posted June 13, 2017 Share Posted June 13, 2017 Like @samme said, it just allows you to fine-tune your animation speed. It has nothing to do with the game framerate. Link to comment Share on other sites More sharing options...
Recommended Posts