new Phaser.Game({
type: Phaser.AUTO,
parent: ‘phaser-canvas’,
width: 1138,
height: 640,
fps: {
target: 30
},
secene: [myScene]
});
When I create a game , I use above code.
When I set the fps is 30, but not take effect.
I open the develop tools,
then you see the following phenomenon
I want to know why???
By default, the game loop uses the requestAnimationFrame API, which always syncs the frame rate to the refresh rate of the player’s monitor. Though I wouldn’t recommend it, if you absolutely must run at 30 FPS, set forceSetTimeOut
to true
.
Note that you shouldn’t rely on the timing of the render loop for game logic. A well-programmed browser game should account for fluctuation in the FPS.
Thanks for your answer.
As you said, my problem is solved.