Jump to content

To update desiredFps relying on device fps it's a bad practice?


gtspina
 Share

Recommended Posts

Hi Guys.

I did some test on my notebook, and the phaser doesn't reach 60FPS, just 40FPS. As this said, I've been having some problem working with the ARCADE physics, considering that it works on a 60FPS constant. The following implementation was a try to solve the problem:

var game = new Phaser.Game(960, 540, Phaser.CANVAS);

var GameState = {
    init: function () {
        this.game.forceSingleUpdate = true;
        this.game.time.desiredFps = this.game.time.fps || 60;

       ...
    },
    update: function() {
        this.game.time.desiredFps = this.game.time.fps || 60;

         this.car.body.velocity.x = 400;
    }
}


Would it be a bad practice fulfill this implementation? Would it be more correct to set aside physics and increase position using the delta time?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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