Implement transitionToMenu() in events.js