summaryrefslogtreecommitdiff
path: root/Levels/IncreaseSize.gd
blob: ed761cea0daa33548727365c18b93998a3d3d904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)