summaryrefslogtreecommitdiff
path: root/Levels/IncreaseSize.gd
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2024-04-14 11:28:24 +0700
committeraltaf-creator <dev@altafcreator.com>2024-04-14 11:28:24 +0700
commit21d3893b6b1c1ffb2d9611bce67568e713161b3d (patch)
tree1360007e7b378e84be3c7d9d596bdcce7c0f8a48 /Levels/IncreaseSize.gd
parentb97ebd793eb17032f3929f307dfe644b17714619 (diff)
IncreaseSize.gd — UNFINISHED, i have to go
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)