texture scrolling

This commit is contained in:
John Alanbrook 2023-06-06 20:49:47 +00:00
parent 8bbf710a5c
commit 180b51993c
3 changed files with 16 additions and 10 deletions

View file

@ -5,5 +5,6 @@
* Implement pausing - stop updates on needed objects * Implement pausing - stop updates on needed objects
* Add GUI layering * Add GUI layering
* Add generic signal sending from C code based on strings * Add generic signal sending from C code based on strings
- Specifically, want to monitor for screen change
- Look up collision functions dynamically instead of with registry - Look up collision functions dynamically instead of with registry

BIN
hexagon_pattern_gray.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

View file

@ -1,7 +1,6 @@
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);
}; };
@ -29,7 +28,7 @@ var options = GUI.column({
hovered: {}, hovered: {},
}); });
options.tt = Tween.start(options, 'hovered', [colorshifter, colorshiftend], {time: 0.35, loop: "restart", whole: false, ease: Ease.quint.out}); Tween.embed(options, 'hovered', [colorshifter, colorshiftend], {time: 0.35, loop: "yoyo", whole: false, ease: Ease.sine.out});
var rainbowchain = [ var rainbowchain = [
[255,0,0,255], [255,0,0,255],
@ -40,29 +39,35 @@ var rainbowchain = [
[255,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 = { var menuopts = {
superpos: [0,0], superpos: [0,0],
color: [],
}; };
Tween.start(menuopts, 'superpos', [Window.dimensions.scale([0.4,0.9]), Window.dimensions.scale([0.6,0.9])], { var stt = Tween.embed(menuopts, 'superpos', [Window.dimensions.scale([0.4,0.9]), Window.dimensions.scale([0.6,0.9])], {
time: 1, time: 1,
loop: "circle", loop: "circle",
whole: false, whole: false,
ease: Ease.cubic.inout ease: Ease.cubic.inout
}); });
Tween.embed(menuopts, 'color', rainbowchain, {time: 1, loop: "circle", whole: false});
var background_gui = GUI.image_fn({path:"hexagon_pattern_gray.png", color: Color.blue, width: Window.width, height: Window.height, image_repeat: true});
Tween.embed(background_gui, 'image_repeat_offset', [[0,0], [1,1]], {time: 1, loop: "repeat"});
function startmenu() { function startmenu() {
GUI.text_fn("SUPER BREAKOUT", {font_size:6, anchor: [0.5,0.5]}).draw(menuopts.superpos); background_gui.draw([0,0]);
stt.update_vals([Window.dimensions.scale([0.4,0.9]), Window.dimensions.scale([0.6,0.9])]);
GUI.text_fn("SUPER BREAKOUT", {font_size:6, anchor: [0.5,0.5], color: menuopts.color}).draw(menuopts.superpos);
options.draw(Window.dimensions.scale([0.5,0.5]).add([-25,0])); options.draw(Window.dimensions.scale([0.5,0.5]));
GUI.image_fn({path:"arrow.png", anchor: [1,0.5]}).draw([item.bb.l, (item.bb.b + item.bb.t)/2].add([-3,1])); // GUI.image_fn({path:"arrow.png", anchor: [1,0.5]}).draw([item.bb.l, (item.bb.b + item.bb.t)/2].add([-3,1]));
} }
register_gui(startmenu); register_gui(startmenu);