Added support for events in the game engine.