turned game engine into an event emitter