Jump to content

Tilemaps and Camera lag


TomFiveThumbs
 Share

Recommended Posts

I'm having a lot of trouble with my tiled game,

 

Everything loads fine, and the FPS is 60, but once the camera begins to follow the player the framerate takes a nosedive.

 

I looked on some Phaser examples, and found that the example posted suffers from the same problem: http://examples.phaser.io/_site/view_full.html?d=tilemaps&f=sci+fly.js&t=sci%20fly

 

Checking the code, I've loaded in my layers the same way. Nothing seems to be different.

 

It just appears that Tilemaps + Game.Camera don't mix at the moment.

Link to comment
Share on other sites

  • 7 months later...

Has anyone else had an update on this? I created a ticket a few months ago and provided a few other examples of people who were experiencing the same thing. I'm using a machine with decent specs so I am unsure what could be bogging it down. The only thing keeping me from using Phaser currently is this. I just attempted it again because I wanted to use it for my next game but the issue persist. Any suggestions or a resolution?

 

https://github.com/photonstorm/phaser/issues/542

https://github.com/photonstorm/phaser/issues/1350

 

The SciFly example is also experiencing the same issue on my machine when the camera is scrolling. 

 

http://examples.phaser.io/_site/view_full.html?d=tilemaps&f=sci%20fly.js&t=sci%20fly&phaser_version=dev&

 

 

Edit: this even appears to have a bit of lag

http://examples.phaser.io/_site/view_full.html?d=p2%20physics&f=tilemap+gravity.js&t=tilemap%20gravity

Link to comment
Share on other sites

  • 1 year later...

Hi,

I've fixed with (From 22FPS to 60FPS) :

    var water = map.createLayer('Water');
    var land = map.createLayer('Land');
    var details = map.createLayer('Details')

    water.renderSettings.enableScrollDelta = true;
    land.renderSettings.enableScrollDelta = true;
    details.renderSettings.enableScrollDelta = true;

  for each layer you enable enableScrollDelta.

I recommend you use Phase.Graphics (or try a diff option to init you game app)

new Phaser.Game(800, 600, Phaser.GRAPHICS, 'game', {preload: preload, create: create, update: update, render: render});

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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