jquery ondrag map load only what has not been viewed

Posted by David on Game Development See other posts from Game Development or by David
Published on 2010-11-09T02:19:24Z Indexed on 2011/01/05 19:00 UTC
Read the original article Hit count: 225

Filed under:
|

When a person mouse down, moves the mouse, and mouses up the system gets the different in the mouse down coord and the mouse up coords and loads in the new map items. However, the problem is it loads them every time so I want a way to track what has been loaded without too much work on checking or storing checks.

  • Most promising. Came up with while typing this. Section the screen into 250x250 sectors and check if that sector has been loaded.

  • Keep track of each corner of the screen and see if there is an area of those that have not loaded.

  • Keep a record of the corners of the screen. When mouse up coords are greater then load the different. Problem is if they are at coord 10,000 then it will load from -10k to 10k positive and that is a lot of items to load.

  • Check every item on the page to see if it is loaded. If I do this I might as well reload the whole page.

If anyone has some suggestions; feel free to pass them on.

© Game Development or respective owner

Related posts about JavaScript

Related posts about maps