Sign in to follow this  
vadim2007

Problem with fps

Recommended Posts

Hi all!

In my phaser game a lot of graphics and animations. I have a trouble with fps, it's gradually fall.. For 10 minutes after start, 60 fps falls to 10 fps. With what it can be connected? I guess, maybe animations not destroy after they are completed? Code looks like this:

//global
var idle,loss;

//create
idle = game.add.sprite(0,0, 'monster_idle');

//idle pressed
loss = game.add.sprite(0,0, 'monster_loss');
idle.destroy();
idle=null;

//on loss animation complete
loss.destroy();
loss=null;
hp-=10;
//and repeat
idle = game.add.sprite(0,0, 'monster_idle');

 

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

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.