Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Disabling the Phaser.Component.PhysicsBody on objects


md_lasalle
 Share

Recommended Posts

Hey guys, I was profiling my game and it seems like I could save some cpu time if I could bypass this function call in my objects' postUpdate :

postUpdate: function() {

        ...

        if (this.components.PhysicsBody)
        {
            Phaser.Component.PhysicsBody.postUpdate.call(this);
        }

        ...
    }

My question is, since my game doesn't use any physics at all, do I have to rebuild phaser without physic support? Or is there a simpler way to simply disable the creation of physics body on all my game objects?

Thanks for any input!

Link to comment
Share on other sites

Thanks Sammy, my frame time spent on scripting and rendering is now below 4ms, extremely smooth 60fps was my target, and you helped me get there. :D

 

Also just throwing it out there, I discovered that accessing the width/height property of a group/sprite was causing an updateTransform call every time! Caching this value was one of the biggest gain I got.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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