python - Mapping coordinates to screen in PyGame -


ok, lots of explaining follow, bear me.

i'm making 2d top-down game in pygame, , have "chunk loading" system set up. system follows...

i have "world" object, made of "chunks". each chunk 16x16 "tiles" , contains data each 1 of tiles. in world object, have system generating these chunks needs be, , storing them in dictionary, {(x, y):"grass"} etc... each tile in chunk 10px image, needs drawn screen in pygame, given position of camera (counted in tiles). want camera able pan around on top of these images, , move around. how on earth can make work?

a quick diagram...

diagram http://williamgardner.noip.me/files/chunks

i hope makes sense, thanks!

if understand problem right, tomtsagk explained good:

pygame camera follow in 2d tile game

hope helps.


Comments