Jump to content

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? 

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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