Sign in to follow this  
gtspina

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

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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.