A Tiled collision layer is just a dense grid of cells. By applying greedy rectangle merging, that grid can be reduced to a small set of non-overlapping rectangles that describe the exact same area, but are far cheaper to use at runtime. Full JavaScript example available with source code.
Subscribe in seconds and receive Emanuele Feronato's news feed updates in your inbox, on your phone or even read them from your own news page here on Specificfeeds.
You can select the updates using tags or topics and you can add as many websites to your feed as you like.
And the service is entirely free!
Follow Emanuele Feronato: Emanuele Feronato – italian geek and PROgrammer