How do I implement layers on a tile map?

Posted by mitch on Game Development See other posts from Game Development or by mitch
Published on 2012-03-27T21:48:38Z Indexed on 2012/03/27 23:44 UTC
Read the original article Hit count: 269

Filed under:

I have a game where, based upon the visible tiles in the viewport, I need to retrieve data of items in the visible tiles. I am planning to use Javascript to AJAX request in a batch based upon the visible tiles which contain image tags like Google Maps. The layer will be in SVG or canvas. The item information will be in JSON format.

What is the best approach, to fetch the data? I currently have complex class I wrote in Javascript which determines the visible columns/rows and offsets relative to the visible area shown. Each item is also user contributed and will be rendered in canvas or SVG layer.

© Game Development or respective owner

Related posts about JavaScript