Jump to content

Phaser 2.6.1 - Increasing RAM with firefox


kuket15
 Share

Recommended Posts

In Firefox the following code seems to eat memory very fast. You can try directly from http://phaser.io/examples

In Windows Task Manager I can see memory constantly grows.

var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update });

function preload() {

    game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}

function create() {

    var sprite = game.add.sprite(200, 200, 'mushroom');

    sprite.tint = Math.random() * 0xffffff;
}

function update() {

    game.state.restart();
}

To be honest I'm not so skilled about garbage collection and how Firefox deals with memory, but I'd expect memory to be cleaned every time the state is restarted.

So, is there anything wrong with this code?

 

Thanks is advance,

Luca

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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