Jump to content

[Phaser - Phonegap] FPS decreases dramatically after 1:30 minutes


temhemka
 Share

Recommended Posts

Hi all,

 

I'm new at Phaser and also game development. I try to run my basic Phaser game on Phonegap and I had achieved that. It runs 60 fps on Nexus 4 and everything is smooth.

 

However after 1:30 minutes, the fps starts to decrease. At first it decreases from 60 to 45 and after a while it decrease from 45 to 30 then from 30 to 25. I waited till 18 fps. I think it would be 5 fps after a while

 

I thought that it can be memory leak and I checked it. I used chrome developer tools to check memory and everything looked ok. 

 

Then I removed my all assets excepts background, I cleared the update function and I checked again but unfortunately I encountered same result.

 

Do you have any idea about that?

 

I used Phaser 2.2.2, Phonegap 3.5 and Android 5.0.1 

Link to comment
Share on other sites

It sure does sound like a memory/resource leak or accidental continual creation of new resources.

 

If you have for sure ruled that out, then one must begin to suspect the environment your game is running in or the device it is running on.  I'd do the following:

1. Check again, in a different way if possible, if you are leaking memory.

2. Try playing somebody else's game on your device and see if the same thing happens.

3. Try playing somebody else's PHASER game on your device and see if the same thing happens.

4. Try your code on another device.

Link to comment
Share on other sites

Hi,

 

First of all, thank you for replies.

 

I check countLiving and countDead. Everything seems ok. For memory leak and recycling, I remove my all assets (just black screen) I just wrote render method for showing fps and the result is same. I think unfortunately  it is Phaser problem.

 

Here my code

window.onload = function () {    var game = new Phaser.Game(800, 450, Phaser.AUTO, 'phaser-example', {preload: preload, render:render});    function preload() {        game.time.advancedTiming = true;    }    function render() {        game.debug.text(game.time.fps || '--', 2, 14, "#00ff00");    }    };
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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