Switches out game loop for event listener instead