summaryrefslogtreecommitdiff
path: root/Levels/IncreaseSize.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Levels/IncreaseSize.gd')
-rw-r--r--Levels/IncreaseSize.gd16
1 files changed, 16 insertions, 0 deletions
diff --git a/Levels/IncreaseSize.gd b/Levels/IncreaseSize.gd
new file mode 100644
index 0000000..ed761ce
--- /dev/null
+++ b/Levels/IncreaseSize.gd
@@ -0,0 +1,16 @@
+extends Node
+class_name IncreaseSize
+## Increase size as [member NumberNode.value] increases.
+
+@export var me : NumberNode
+@export var player : Node # Should be [Player] or [AI]
+
+@export var max_value : int
+@export var min_size : float
+@export var max_size : float
+@export var min_range : float
+@export var max_range : float
+
+func _process(_delta):
+ var scale = min_size + ((max_size - min_size) * ((max_value - (max_value - clampf(me.value, 0, max_value))) / max_value))
+ me.scale = Vector2(scale, scale)