1

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...

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

I hope this makes sense, thanks!

1 Answer 1

1

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

Pygame camera follow in a 2d tile game

Hope this helps.

1
  • That's not exactly what I want, but I think I can adapt it slightly, thanks!
    – wg4568
    Sep 2, 2016 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.