Search the Community

Showing results for tags 'memory management'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Platform
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 5 results

  1. wkd-aine

    FireFox Lag

    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
  2. In Firefox the following code seems to eat memory very fast. You can try directly from 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
  3. Hi, I have a phaser game and i'm using cocoon js to port it to android and IOS. unfortunately in IOS, since I am loading many images, it leads to a memory low warning and the app crashes. How do i delete the textures from the memory? Is there any way to clear the memory? I have tried cache.removeImage, cache.destroy and textureImage.destroy but doesnt seem to help much. Any help would be greatly appreciated. Thanks
  4. Hello! i'm creating a bullet-hell type game in phaser. When alot of bullet sprites are being created ingame (~10 sprites/second, size = 5x5 px), i get consistent lagspikes, and graphic bugs caused by the lag... Is this normal? Anything i can do to increase performance? Here's the code to create bullet sprites: ...this.bulletGroup =;this.bulletGroup.enableBody = true;this.bulletGroup.physicsBodyType = Phaser.Physics.ARCADE;this.bulletList = []...this.timeCheck =; this.shoot = function(bulletSpeed, bulletRate, bulletTexture){ if ( > this.timeCheck + bulletRate) { var bullet = this.bulletGroup.create(this.sprite.x, this.sprite.y, bulletTexture); bullet.anchor.setTo(0.5,0.5); game.physics.arcade.moveToXY(bullet, player.sprite.x, player.sprite.y, bulletSpeed); this.bulletList.push(bullet); this.timeCheck =; }}; this.shoot_update = function(type, phase){ for(var i = 0; i < this.bulletList.length; i++){ this.bulletList[i].body.x += Math.sin(phase*0.1)*5; }};// this.shoot and this.shoot_update are called in update()
  5. Hello, I finish making a simple game today with Phaser: I found that in some desktop or mobile device, the game lag a little bit after I press 'PLAY AGAIN' button. I think this is because I have to clear out some variables but I'm not sure how to do this in Phaser. So my question is: Does anyone has good tips for memory management / clear out variables data in Phaser? Most elements I used in my game is group, sprite, text, and sound.