Night 2: scrolly map with joystick input
After a second night of coding I have a basic pysdl2-cfffi RenderCopyEx-based renderer for PyTMX maps that supports flipped and rotated tiles (the tile layer, not the object layer). I'm not 100% sure it matches Tiled in every case, but it is really nice to be able to get more mileage out of the same tiles by spinning them around. It took me a while to figure out that you can use the X, Y, and Z keys inside Tiled for flip & rotate; the keyboard shortcuts don't seem to be shown in the menus at all; you have to use the online docs.
An input class keeps track of gamepad add/remove events and synthesizes the keyboard and gamepad states at the beginning of each frame into more useful "x motion", "y motion" and "jump" states. And you can scroll around the little map to prove the input is working.
The game also has a 2-screen intro with an image and some sdl.renderUTF8_Blended_Wrapped text - a handy under-documented function that renders several lines of text in one call.
So far I'm very pleased with how much better organized the code is than my previous SDL adventures. Instead of having a giant game loop with everything, it has a simple game loop that delegates to classes that take care of the different aspects of what the program has to do. I'm hoping to be able to keep the core event loop generic and have it always just call 'render' and 'advance(dt)' on whichever scene is current.