Recommended Posts

Hi,

 

I am working on a game where the hero runs through different levels and collects rewards, and have got it working really smoothly for Chrome on Mac, however when testing on FireFox on Mac or Windows it goes really laggy.

At its most simple, the game uses a tilemap (70 x 15), which also handles the objects, the objects are split into various classes, and there are two background images (originally for parallax, but this has been disabled while we try and resolve the lagginess).

The hero and a couple of other sprite objects have animations, but again these have been temporarily disabled, even with all of this there is still significant lag when running and jumping, its a reasonably large game so not really sure what code would be helpful without causing more confusion.

 

I've tried several different approaches now, with no success.

I have tried changing the 'renderer' for the game, the best result so far is CANVAS, not sure if it makes any difference but the physics library is P2, and I am only pre-loading the assets required for the current level.

I have tried killing sprites, setting their visiblity to false, only dumping out a subset of objects, and none of it seems to affect anything.

 

I have done some investigation, and the 'requestAnimationFrame' function seems to get called alot but the garbage cleaner not so much.

 

I had a look at pixi.js and there is an issue from which looks to be similar but not the same.

 

Has anyone else had this issue, know where I should investigate next?

 

Many thanks,

Áine

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.