mirror of
https://github.com/mightypanders/GMTKJam2021.git
synced 2025-01-30 21:59:55 +01:00
23 lines
429 B
GDScript
23 lines
429 B
GDScript
extends Node
|
|
|
|
var colorList = [
|
|
Color.yellow,
|
|
Color.violet,
|
|
Color.red,
|
|
Color.turquoise,
|
|
]
|
|
|
|
onready var rng = RandomNumberGenerator.new()
|
|
onready var dropOffChildern = get_children()
|
|
|
|
func _ready():
|
|
rng.randomize()
|
|
|
|
func random_color() -> Color:
|
|
var n = rng.randi_range(0,colorList.size()-1)
|
|
return colorList[n]
|
|
|
|
func set_colors():
|
|
for dop in dropOffChildern:
|
|
dop.destinationColor = random_color()
|
|
dop.modulate_color() |