Jump to content

How does Phaser handle huge amounts of assets?


ol-web
 Share

Recommended Posts

Let's say I make a game in Phaser that:

  • contains just a single scene
  • on that scene there is a giant tilemap loaded with collisions set with ,setCollisionBetween() or similiar
  • there are multiple sprites scattered all across the map, they collide with the player

How does Phaser handle the tilemap, the sprites and collision in this case? Does it update the entire tilemap wherever the player is or only the chunk that is currently within the camera bounds? Does it check collisions with tiles and sprites that are only within the camera bounds or everywhere on the map despite the player not even being there? Is everything built for me internally or do I have to implement my own tile,sprite and collision loading to not waste performance? 

Link to comment
Share on other sites

On 7/3/2018 at 6:38 PM, samme said:

The map is drawn only within the camera's view.

Tile collisions are checked only on tiles adjacent to the sprite (whether in camera or not).

oh, that's lovely! so I can make a huge map then. what about sprites scattered all around the map? are they rendered and collision-checked only in camera view too or is better for performance to handle myself?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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