function startmenu() { GUI.column([ GUI.text.bind(this,"Press ENTER to start"), GUI.text.bind(this,"Press ESCAPE to exit"), ]); } register_gui(startmenu); var startcontroller = { input_enter_pressed() { run("breakout.js"); Player.players[0].uncontrol(startcontroller); unregister_gui(startmenu); }, input_escape_pressed() { quit(); }, }; Player.players[0].control(startcontroller);