From bc43de64d9e9a5a5e872afd60cd976fae11c7478 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 2 Oct 2023 18:42:10 +0200 Subject: [PATCH] Fix gem value --- entity/gem/RandomValue.gd | 7 ++++++- entity/gem/gem.tscn | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/entity/gem/RandomValue.gd b/entity/gem/RandomValue.gd index 3b76b51..e72ea7a 100644 --- a/entity/gem/RandomValue.gd +++ b/entity/gem/RandomValue.gd @@ -1,4 +1,9 @@ extends Node + +@export var min_value: int +@export var max_value: int + + func _ready(): - get_parent().value=Randomizer.rng.randi_range(0,360) + get_parent().value = Randomizer.rng.randi_range(min_value, max_value) diff --git a/entity/gem/gem.tscn b/entity/gem/gem.tscn index 29f0f5f..08cd7e6 100644 --- a/entity/gem/gem.tscn +++ b/entity/gem/gem.tscn @@ -38,10 +38,12 @@ shader = ExtResource("5_v6ppl") type = &"Gem" [node name="Valuable" parent="." instance=ExtResource("5_7bd6c")] -value = 10 +value = 1000 [node name="RandomValue" type="Node" parent="Valuable"] script = ExtResource("6_3lulr") +min_value = 900 +max_value = 1300 [node name="SoundWorking" type="AudioStreamPlayer" parent="."] stream = ExtResource("6_svrnw")