From 21d3893b6b1c1ffb2d9611bce67568e713161b3d Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 14 Apr 2024 11:28:24 +0700 Subject: =?UTF-8?q?IncreaseSize.gd=20=E2=80=94=20UNFINISHED,=20i=20have=20?= =?UTF-8?q?to=20go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Levels/IncreaseSize.gd | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Levels/IncreaseSize.gd (limited to 'Levels/IncreaseSize.gd') 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) -- cgit v1.2.3