An event-driven game engine I built for fun in Python. It's built on the pygame framework (see www.pygame.org). You'll need to install pygame in order to run this. The overall design is similar to and was inspired by Game Maker, published by Yoyo Games (see http://www.yoyogames.com/studio). The code has some basic documentation, and if you look at the code for snake.py and tetris.py you might be able to figure out how to make things work.
This is still a work in progress.
To run, execute this in the command line:
$ ./snake.py
Controls: arrow keys or WASD to move. Escape to quit.
To run, execute this in the command line:
$ ./tetris.py
Controls: arrow keys to move the current piece, A and D to rotate it, and S to insta-drop the piece. Escape to quit.