This commit is contained in:
John Alanbrook 2023-06-05 22:19:35 +00:00
parent 1ac4693931
commit ec96c33a78
2 changed files with 14 additions and 6 deletions

View file

@ -191,6 +191,8 @@ var gamepawn =
},
input_escape_pressed() {
backtomain();
return;
this.pause();
Player.players[0].uncontrol(gamepawn);
Player.players[0].control(pause);

View file

@ -1,6 +1,7 @@
var startgame = function()
{
run("breakout.js");
options.tt.stop();
Player.players[0].uncontrol(startcontroller);
unregister_gui(startmenu);
};
@ -10,21 +11,26 @@ var exitgame = function()
quit();
};
var colorshifter = {
color: Color.green,
font_size: 1,
};
Tween.start(colorshifter.color, Color.green, Color.blue);
var colorshiftend = {
color: Color.blue,
font_size: 1.5
};
var options = GUI.column({
items: [
GUI.text_fn("START", {action: startgame, hovered: colorshifter }),
GUI.text_fn("START", {action: startgame}),
GUI.text_fn("EXIT", {action: exitgame}),
],
hovered: {
color: Color.blue,
},
hovered: {},
});
options.tt = Tween.start(options, 'hovered', colorshifter, colorshiftend, {time: 0.25, loop: "yoyo", ease: Ease.sine.inout});
var idx = 0;
var item = options.items[idx];
@ -52,7 +58,7 @@ var startcontroller = {
item.selected = false;
idx = Math.clamp(idx-1, 0, options.items.length-1);
item = options.items[idx];
item.selected = true;
item.selected = true;
},
input_enter_pressed() {