diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-09-28 15:29:16 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-09-28 15:29:16 +0200 |
commit | 62e90b444315245ef24606fa51d3fccba5f18e08 (patch) | |
tree | 3a8a7390cf319d6a4ddd70bf32ca83fbe20bec31 /Stage/balloons.gd |
Diffstat (limited to 'Stage/balloons.gd')
-rw-r--r-- | Stage/balloons.gd | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Stage/balloons.gd b/Stage/balloons.gd new file mode 100644 index 0000000..a242bc0 --- /dev/null +++ b/Stage/balloons.gd @@ -0,0 +1,12 @@ +extends Node2D + + +func _on_spawn_timer_timeout() -> void: + var balloon = preload("res://Target/balloon.tscn").instantiate() + balloon.global_position = Vector2( + randf_range(get_viewport_rect().position.x, get_viewport_rect().end.x), + randf_range(get_viewport_rect().position.y, get_viewport_rect().end.y) + ) + balloon.velocity = Vector2(randf_range(-1.0, 1.0) * 20, randf_range(-1.0, 1.0) * 20) + balloon.modulate = Color(randf(), randf(), randf()) + add_child(balloon) |