summaryrefslogtreecommitdiff
path: root/Scripts/NumberNode.gd
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2024-04-13 18:49:03 +0700
committeraltaf-creator <dev@altafcreator.com>2024-04-13 18:49:03 +0700
commitc5a806528af8a4de5f903d26cd33edb7e0bb6597 (patch)
tree619f07a7a7f8b2e65fc97e9f04212d2c7c8c686e /Scripts/NumberNode.gd
parent24f5e910dd8f575adc483f768422ab51fdf905cc (diff)
unfinished map generator
Diffstat (limited to 'Scripts/NumberNode.gd')
-rw-r--r--Scripts/NumberNode.gd16
1 files changed, 12 insertions, 4 deletions
diff --git a/Scripts/NumberNode.gd b/Scripts/NumberNode.gd
index ca80530..41c5d4a 100644
--- a/Scripts/NumberNode.gd
+++ b/Scripts/NumberNode.gd
@@ -3,7 +3,7 @@ class_name NumberNode
@export_group("Values")
@export var value : int
-@export var modifier : int
+@export var modifier : float
enum Operations {
NONE,
ADDITION,
@@ -36,11 +36,11 @@ func join_from(node : NumberNode):
node.value += self.value
if self.modifier_operation == Operations.ADDITION:
- node.value += self.modifier
+ node.value += roundi(self.modifier)
if self.modifier_operation == Operations.SUBTRACTION:
- node.value -= self.modifier
+ node.value -= roundi(self.modifier)
if self.modifier_operation == Operations.MULTIPLICATION:
- node.value = node.value * self.modifier
+ node.value = roundi(float(node.value) * self.modifier)
if self.modifier_operation == Operations.DIVISION:
node.value = roundi(float(node.value) / float(self.modifier))
@@ -55,12 +55,20 @@ func update_visuals():
if self.modifier_operation == Operations.ADDITION:
label_modifier.text = "+ " + str(self.modifier)
+ sprite_modifier.visible = true
+ label_modifier.visible = true
if self.modifier_operation == Operations.SUBTRACTION:
label_modifier.text = "- " + str(self.modifier)
+ sprite_modifier.visible = true
+ label_modifier.visible = true
if self.modifier_operation == Operations.MULTIPLICATION:
label_modifier.text = "× " + str(self.modifier)
+ sprite_modifier.visible = true
+ label_modifier.visible = true
if self.modifier_operation == Operations.DIVISION:
label_modifier.text = "÷ " + str(self.modifier)
+ sprite_modifier.visible = true
+ label_modifier.visible = true
if self.modifier_operation == Operations.NONE:
sprite_modifier.visible = false
label_modifier.visible = false