This commit is contained in:
John Alanbrook 2023-06-06 13:07:18 +00:00
parent ef811a9174
commit 8bbf710a5c

View file

@ -1,9 +1,9 @@
var startgame = function() var startgame = function()
{ {
run("breakout.js"); run("breakout.js");
options.tt.stop(); options.tt.stop();
Player.players[0].uncontrol(startcontroller); Player.players[0].uncontrol(startcontroller);
unregister_gui(startmenu); unregister_gui(startmenu);
}; };
var exitgame = function() var exitgame = function()
@ -11,7 +11,6 @@ var exitgame = function()
quit(); quit();
}; };
var colorshifter = { var colorshifter = {
color: Color.green, color: Color.green,
font_size: 1, font_size: 1,
@ -30,14 +29,36 @@ var options = GUI.column({
hovered: {}, hovered: {},
}); });
options.tt = Tween.start(options, 'hovered', colorshifter, colorshiftend, {time: 0.25, loop: "yoyo", ease: Ease.sine.out}); options.tt = Tween.start(options, 'hovered', [colorshifter, colorshiftend], {time: 0.35, loop: "restart", whole: false, ease: Ease.quint.out});
var rainbowchain = [
[255,0,0,255],
[255,255,0,255],
[0,255,0,255],
[0,255,255,255],
[0,0,255,255],
[255,0,255,255],
];
//Tween.start(options.hovered, 'color', rainbowchain, {time: 4, loop: "circle", whole: true});
var idx = 0; var idx = 0;
var item = options.items[idx]; var item = options.items[idx];
item.selected = true; item.selected = true;
var menuopts = {
superpos: [0,0],
};
Tween.start(menuopts, 'superpos', [Window.dimensions.scale([0.4,0.9]), Window.dimensions.scale([0.6,0.9])], {
time: 1,
loop: "circle",
whole: false,
ease: Ease.cubic.inout
});
function startmenu() { function startmenu() {
GUI.text_fn("SUPER BREAKOUT", {font_size:6, anchor: [0.5,0.5]}).draw(Window.dimensions.scale([0.5,0.9])); GUI.text_fn("SUPER BREAKOUT", {font_size:6, anchor: [0.5,0.5]}).draw(menuopts.superpos);
options.draw(Window.dimensions.scale([0.5,0.5]).add([-25,0])); options.draw(Window.dimensions.scale([0.5,0.5]).add([-25,0]));