35 lines
871 B
JavaScript
35 lines
871 B
JavaScript
function startmenu() {
|
|
GUI.text_fn("SUPER BREAKOUT", {font_size:6, anchor: [0.5,0.5]}).draw(Window.dimensions.scale([0.5,0.9]));
|
|
var options = GUI.column({
|
|
items: [
|
|
GUI.text_fn("Press ENTER start"),
|
|
GUI.text_fn("Press ESCAPE to exit"),
|
|
GUI.text_fn("Press H for help"),
|
|
GUI.image_fn({path:"bigball.png"}),
|
|
GUI.image_fn({path:"arrow.png"}),
|
|
],
|
|
anchor: [0.5,0],
|
|
font_size: 2,
|
|
});
|
|
|
|
options.draw(Window.dimensions.scale([0.5,0.5]));
|
|
|
|
GUI.image_fn({path:"arrow.png", anchor: [0,0]}).draw([options.items[0].bb.l, options.items[0].bb.t]);
|
|
}
|
|
|
|
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);
|