online multiplayer chess game (note server currently down)
Diffstat (limited to 'ui/StartMenu.gd')
| -rw-r--r-- | ui/StartMenu.gd | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/StartMenu.gd b/ui/StartMenu.gd index 9228cc3..2bbcabe 100644 --- a/ui/StartMenu.gd +++ b/ui/StartMenu.gd @@ -12,10 +12,6 @@ onready var tween := $Tween onready var timer := $Timer -func _on_local_pressed(): - get_tree().change_scene_to(world) - - func _ready(): randomize() colorrect.color = nice_colors[randi() % nice_colors.size()] @@ -23,6 +19,14 @@ func _ready(): _on_Timer_timeout() +func rand(clr): + return clamp(clr + rand_range(0, .1) if randi() % 2 else clr - rand_range(0, .1), 0, 1) + + +func _on_local_pressed(): + get_tree().change_scene_to(world) + + func _on_quit_pressed(): get_tree().quit() @@ -39,7 +43,3 @@ func _on_Timer_timeout(): tween.interpolate_property(colorrect, "color", colorrect.color, clr, timer_length, Tween.TRANS_ELASTIC) tween.start() timer.start(timer_length) - - -func rand(clr): - return clamp(clr + rand_range(0, .1) if randi() % 2 else clr - rand_range(0, .1), 0, 1) |