tweens
This commit is contained in:
parent
1ac4693931
commit
ec96c33a78
|
@ -191,6 +191,8 @@ var gamepawn =
|
||||||
},
|
},
|
||||||
|
|
||||||
input_escape_pressed() {
|
input_escape_pressed() {
|
||||||
|
backtomain();
|
||||||
|
return;
|
||||||
this.pause();
|
this.pause();
|
||||||
Player.players[0].uncontrol(gamepawn);
|
Player.players[0].uncontrol(gamepawn);
|
||||||
Player.players[0].control(pause);
|
Player.players[0].control(pause);
|
||||||
|
|
16
startmenu.js
16
startmenu.js
|
@ -1,6 +1,7 @@
|
||||||
var startgame = function()
|
var startgame = function()
|
||||||
{
|
{
|
||||||
run("breakout.js");
|
run("breakout.js");
|
||||||
|
options.tt.stop();
|
||||||
Player.players[0].uncontrol(startcontroller);
|
Player.players[0].uncontrol(startcontroller);
|
||||||
unregister_gui(startmenu);
|
unregister_gui(startmenu);
|
||||||
};
|
};
|
||||||
|
@ -10,22 +11,27 @@ var exitgame = function()
|
||||||
quit();
|
quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var colorshifter = {
|
var colorshifter = {
|
||||||
color: Color.green,
|
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({
|
var options = GUI.column({
|
||||||
items: [
|
items: [
|
||||||
GUI.text_fn("START", {action: startgame, hovered: colorshifter }),
|
GUI.text_fn("START", {action: startgame}),
|
||||||
GUI.text_fn("EXIT", {action: exitgame}),
|
GUI.text_fn("EXIT", {action: exitgame}),
|
||||||
],
|
],
|
||||||
hovered: {
|
hovered: {},
|
||||||
color: Color.blue,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
options.tt = Tween.start(options, 'hovered', colorshifter, colorshiftend, {time: 0.25, loop: "yoyo", ease: Ease.sine.inout});
|
||||||
|
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
var item = options.items[idx];
|
var item = options.items[idx];
|
||||||
item.selected = true;
|
item.selected = true;
|
||||||
|
|
Loading…
Reference in a new issue