Rudimentary game engine, for learning purposes only