Sign in to follow this  
ol-web

How does Phaser handle huge amounts of assets?

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? 

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.