online multiplayer chess game (note server currently down)
Diffstat (limited to 'ui/background/ColorfullBackground.gd')
| -rw-r--r-- | ui/background/ColorfullBackground.gd | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ui/background/ColorfullBackground.gd b/ui/background/ColorfullBackground.gd index e4cfcfe..590211d 100644 --- a/ui/background/ColorfullBackground.gd +++ b/ui/background/ColorfullBackground.gd @@ -1,6 +1,6 @@ extends ColorRect -export(Array, Color) var colors = [ +export(PoolColorArray) var colors := [ Color(0.784314, 0.427451, 0.427451, 1), Color(0.913725, 0.847059, 0.403922, 1), Color(0.380392, 0.741176, 0.647059, 1), @@ -12,17 +12,17 @@ export(Array, Color) var colors = [ Color(0.984314, 0.858824, 0.282353, 1), Color(0.164706, 0.0862745, 0.247059, 1) ] -export(float) var length = 2.8 +export(float) var length := 2.8 -var tween = Tween.new() -var timer = Timer.new() +var tween := Tween.new() +var timer := Timer.new() static func rand(clr) -> float: return clamp(clr + rand_range(0, .1) if randi() % 2 else clr - rand_range(0, .1), 0, 1) -func _ready(): +func _ready() -> void: randomize() add_child(timer) add_child(tween) @@ -31,8 +31,8 @@ func _ready(): change_color() -func change_color(): - var clr = colors[randi() % colors.size()] +func change_color() -> void: + var clr: Color = colors[randi() % colors.size()] clr = Color(rand(clr.r), rand(clr.g), rand(clr.b), 1) tween.interpolate_property(self, "color", color, clr, length, Tween.TRANS_ELASTIC) tween.start() |