mirror of
https://github.com/Steffo99/looping-for-loops.git
synced 2024-11-22 08:04:23 +00:00
18 lines
269 B
GDScript3
18 lines
269 B
GDScript3
|
extends Area2D
|
||
|
class_name Loop
|
||
|
|
||
|
var rng = RandomNumberGenerator.new()
|
||
|
|
||
|
|
||
|
signal picked_up
|
||
|
|
||
|
|
||
|
func _ready():
|
||
|
rng.randomize()
|
||
|
$Sprite.modulate = Color.from_hsv(rng.randf_range(0.0, 1.0), 0.4, 1)
|
||
|
|
||
|
|
||
|
func _on_Loop_body_entered(body):
|
||
|
emit_signal("picked_up")
|
||
|
queue_free()
|