Zooming and Scrolling
At the moment, the zoom function zooms into the top left corner, but it ought to zoom into the center of the screen. Additionally, the scrolling currently is independent of the level of zoom, but it should cover larger distances when zoomed out. Some discussion might be in order as to the optimal way for scrolling and zooming to work.
We should probably also use pygame.key.set_repeat(delay, intereval) to improve scrolling.
The zooming definitely needs work. I basically just tossed in the crappy zoom functionality because it was easy. A proper zoom will calculate the approximate center pixel of the current view, change the zoom value and then move the viewportX and viewportY to recenter before redrawing.
As for scrolling, we should have a scroll speed setting that represents a percentage of the screen. If, for example, it is set to 10% and you are zoomed way in so that you only see a 10x10 grid, then you will scroll one square at a time. If you are zoomed out and see a 1000x1000 grid, you will scroll 100 squares at a time.
Okay, I've fixed much of this with my latest commit, and split off all the view port functionality into a separate ViewPort class in view_port.py
Zoom levels are still defined in terms of the block size (in pixels), but I changed the zoom levels to work with a 1.5x multiplier instead since I feel this is a more natural approach to zooming. However, this also has the slight problem that there may be a slight black border if the screen resolution is not divisible by the block size.
As for scrolling, it is currently defined in terms of the number of pixels to scroll by as well. I decided it was logical that at the max zoom level, the scroll distance would correspond to a single grid square.
I'm not sure if it's entirely satisfactory yet, but it's definitely better.
Okay, now that the approach is to scale the grid to the screein using pygame.transform.scale, the co-ordinate systems don't quite match up, as you can see if you create movers at the intermediate zoom levels. We either need to change the scaling to use less than the whole screen, or change the zoom levels to ensure that the block sizes divide nicely into the screen resolution.
I changed the zoom levels to a discrete set that does divide nicely. The set of values isn't so nice, and it doesn't change with the game's resolution, but I guess it'll do the job.