summaryrefslogtreecommitdiff
path: root/Globals.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Globals.gd')
-rw-r--r--Globals.gd8
1 files changed, 6 insertions, 2 deletions
diff --git a/Globals.gd b/Globals.gd
index 47c5d24..9078635 100644
--- a/Globals.gd
+++ b/Globals.gd
@@ -7,8 +7,12 @@ const LIMITS_MIN = -LIMITS / 2
const LIMITS_MAX = LIMITS / 2
var FUN = false
+@onready var _primogem: PackedScene = load("res://coin.tscn")
+
+func _ready() -> void:
+ randomize()
+
func spawn_primogem(pos: Vector2) -> void:
- var primogem: PackedScene = load("res://coin.tscn")
- var e: Area2D = primogem.instantiate()
+ var e: Area2D = _primogem.instantiate()
e.position = Vector2(pos.x, pos.y)
get_node("../Game/Coins").add_child(e)