i was wondering what the best approach would be for a side-scrolling, with wrap-around, world map scenario.
The idea is that my world coordinates go from (i’ll use numbers to make things easier to talk about).
0 ---- 1000
but the screen is displaying the world in chunks as the player moves
center-50 — center+50
with the obvious problem as to how to handle the wrap from 1000 to 0.
There are two ways (and probably more) one could approach this.
1 actually generate a world coordinate system of 0 to 1000, draw everything, and simply move the viewport so that it’s centered at an offset and let the viewport clip everything. Not sure how to handle the wrap around, but i’m sure i can kluge it (two viewports adjacent to each other ?)
2 the other option is to maintain a “logical world” and simply run a search to figure out what’s in the current viewport and then map the world coordinates to viewport coordinates.
I think 2 is the better option and probably what’s generally done for any sort of game scenario. it allows you to maintain sparse collection of objects and do no work on things that are clearly out of the display.
I’m just wondering if there is support in Panda for either of these scenarios before i go and write the code.