I’m writing a 2D Elite-style game in Python+Pygame, and I need to move the starmap about so the player can look at the whole thing.
The way I’ve done this sort of thing before is to just add the coordinates of the ‘camera’ to the coordinates of everything else when drawing. However, I notice Pygame has a function to move the entirety of a surface some amount. Would this be a quicker, easier way to implement this functionality?
The starmap is about 100,000 pixels square, if it depends on the size of the image.
Well for starters, one huge bitmap is not really good, since it eats away resources.
What I do, is divide the map into size of camera, and end up with having 9 tiles displayed at a time, moving the camera shifts the map, and draws only the ones that are seen.
There isn’t a huge improvement though.
You can always try the easier approach, and if you feel that the game is too slow, you can try another.
There is no point of optimizing if you can’t see the difference.