Jump to content

Cannot move camera with tilemaps on mobile


Partsu
 Share

Recommended Posts

I have noticed that I cannot use tilemaps with most mobile devices (e.g., Android and iPad 1) as the game starts to lag when the camera is supposed to move. :o

 

To test this, I took the "sci fly" from the examples and added some simple touch controls. Now I can play the game just fine if I keep the player sprite near the starting point. Once the sprite travels further, the game starts to lag and eventually practically freezes. If I disable the camera.follow from the moving sprite, there are no problems.

 

I also tried to add controls to move the camera itself with the touch controls and the game froze immediately when I touched it. Has anyone else experienced this? I am using Phaser 2.2.2.

Link to comment
Share on other sites

  • 2 weeks later...

This has become a real issue on developing mobile games with Phaser. I have noticed that most Android devices also fail to scroll the tilemaps, as does iPhone 4s.

I made a simple example of this problem by modifying the "sci fly" example from the Phaser examples to include touch controls: http://users.jyu.fi/~petmikpa/tilemaps/

 

The game will freeze once the screen is supposed to begin to scroll. You need to fly a little bit to have the effect. I'm not quite sure where to start to solve this issue. Without the tilemap functionality Phaser becomes totally unusable for my project. Can it even be resolved?

Link to comment
Share on other sites

It seems that at least iPad throws an error message to the developer log when the game freezes:

 

INDEX_SIZE_ERR: DOM Exception 1 : Index or size was negative, or greater than the allowed value

 

Unfortunately Firebug is not able to give out the line where this occurs.

Link to comment
Share on other sites

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

 

maybe this helps a little bit..     there is a tilemap plugin for phaser called "tiledmap" (i believe its called that way.. search the forum! )  that should give you better performance results.

 

with this testgame of mine  http://test.xapient.net/phaser/attm/  i have 45 frames on my oneplus one and 40 on my nexus 7 most of the time.. this is without the plugin..  i should be much better with the plugin

Link to comment
Share on other sites

Thank you.

 

The Tiledmap plugin clearly performs much better. There are still issues with iPad 1 but that is due to the very old Safari. Hopefully the development of the plugin has not ceased as the Phaser's own tilemap system is quite broken as it is. There are still some things the plugin does not have, such as the arcade support.

Link to comment
Share on other sites

  • 5 months later...
 Share

  • Recently Browsing   0 members

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