updated menu to not accept presses while "scrambling"

This commit is contained in:
Gordon Pedersen 2023-08-17 11:19:16 +10:00
parent 24d176ec53
commit 81c60b7a2a
2 changed files with 7 additions and 3 deletions

4
package Normal file → Executable file
View file

@ -2,4 +2,6 @@
cd "`dirname "$0"`"/.dragonruby
cp -R ../marketing-assets/AppIcon.appiconset ./dragonruby-ios.app/Assets.xcassets/
cp -R ../marketing-assets/AppIcon.appiconset ./dragonruby-ios-simulator.app/Assets.xcassets/
exec ./dragonruby-publish --only-package ../🕹cube-tube
cp -R ../🕹cube-tube ./cube-tube
exec ./dragonruby-publish --only-package cube-tube
rmdir -R ./cube-tube

View file

@ -39,7 +39,9 @@ class MenuScene < SceneInstance
text(option[:key])
end
if (args.state.tick_count - @first_render) < 60 * (1.5 + i) * 0.2
scramble = (args.state.tick_count - @first_render) < 60 * (1.5 + i) * 0.2
if scramble
if args.state.tick_count % 4 == 0
@rand_strings[i] = (0...(rand(text.length >= 3 ? text.length : 3) + 3)).map { ('A'..'Z').to_a[rand(26)] }.join
end
@ -73,7 +75,7 @@ class MenuScene < SceneInstance
button_border = { w: 340, h: 80, x: l.x - 170, y: l.y - 55 }.merge(WHITE)
# (args.outputs.borders << button_border) if mobile?
if args.inputs.mouse.up && args.inputs.mouse.inside_rect?(button_border)
if args.inputs.mouse.up && args.inputs.mouse.inside_rect?(button_border) && !scramble
o = @menu_options.find { |o| o[:key] == l[:key] }
Sound.play(args, :menu)
o[:on_select].call(args) if o