I confess I did not know how to do graphics in python. No problem though. There is a pygame module with a simple API that I can make use of. So now I have a 2D maze in a python structure (a list of lists). And I can draw that maze onto the screen. The maze is not impressive. It is just an outline of a rectangular big room. Baby steps.
I also have drawn the player character in the center of the screen. Pygame let's you accept and process keyboard inputs. So I have coded handling of the arrow keys. The player can now move around the screen. The player can also walk through walls currently. So that might be the next thing I code in there. Might also revisit the screen colors. That should be easy.
No comments:
Post a Comment