tweens
This commit is contained in:
parent
1ac4693931
commit
ec96c33a78
|
@ -191,6 +191,8 @@ var gamepawn =
|
|||
},
|
||||
|
||||
input_escape_pressed() {
|
||||
backtomain();
|
||||
return;
|
||||
this.pause();
|
||||
Player.players[0].uncontrol(gamepawn);
|
||||
Player.players[0].control(pause);
|
||||
|
|
16
startmenu.js
16
startmenu.js
|
@ -1,6 +1,7 @@
|
|||
var startgame = function()
|
||||
{
|
||||
run("breakout.js");
|
||||
options.tt.stop();
|
||||
Player.players[0].uncontrol(startcontroller);
|
||||
unregister_gui(startmenu);
|
||||
};
|
||||
|
@ -10,22 +11,27 @@ 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];
|
||||
item.selected = true;
|
||||
|
|
Loading…
Reference in a new issue