diff options
author | altaf-creator <dev@altafcreator.com> | 2024-04-13 18:49:03 +0700 |
---|---|---|
committer | altaf-creator <dev@altafcreator.com> | 2024-04-13 18:49:03 +0700 |
commit | c5a806528af8a4de5f903d26cd33edb7e0bb6597 (patch) | |
tree | 619f07a7a7f8b2e65fc97e9f04212d2c7c8c686e /Scripts/NumberNode.gd | |
parent | 24f5e910dd8f575adc483f768422ab51fdf905cc (diff) |
unfinished map generator
Diffstat (limited to 'Scripts/NumberNode.gd')
-rw-r--r-- | Scripts/NumberNode.gd | 16 |
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 |