First attempt at making a game engine from scratch