GMTKJam2021/DropOffPoints.gd

23 lines
424 B
GDScript3
Raw Permalink Normal View History

2021-06-25 22:09:44 +02:00
extends Node
var colorList = [
Color.yellow,
Color.violet,
Color.red,
2021-07-01 19:32:30 +02:00
Color.blue,
2021-06-25 22:09:44 +02:00
]
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()