Mapping coordinates to screen in PyGame

Ok, lots of explaining to follow, so bear with me.

I'm making a 2D top-down game in PyGame, and I have a "chunk loading" system set up. The system is as follows...

I have a "world" object, made up of "chunks". Each chunk is 16x16 "tiles" and contains data for each one of those tiles. In the world object, I have a system for generating these chunks as needs be, and storing them in a dictionary, like {(x, y):"grass"} etc... Each tile in the chunk is a 10px image, that needs to be drawn to the screen in PyGame, given the position of the camera (counted in tiles). I want the camera to be able to pan around over the top of these images, and move around. How on earth can I make this work?

A quick diagram...


I hope this makes sense, thanks!


If I understand your problem right, TomTsagk explained it really good:

Pygame camera follow in a 2d tile game

Hope this helps.

Need Your Help

how to limit tag-it input in jquery

jquery input tags limit tag-it

How will I be able to limit the number of inputs a user can input from a Tag-It feature in jquery? I am currently using this plugin, but I would only want the user to be able to input 3 types of ta...

Pass dynamic id value jquery div jump to function

javascript jquery

I am stuck at jquery div jump to problem. The problem is that i am creating dynamic <a href="" id="1_1"></a> and dynamic div also say <div id="1_1_div"></div> i am using fol...