From f1b4d6034c937c89b2750bc209684a4e19896177 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 14 Apr 2024 23:00:45 +0700 Subject: Art overhaul --- Scripts/NumberNode.gd | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Scripts/NumberNode.gd') diff --git a/Scripts/NumberNode.gd b/Scripts/NumberNode.gd index b566781..016a83c 100644 --- a/Scripts/NumberNode.gd +++ b/Scripts/NumberNode.gd @@ -19,17 +19,27 @@ enum Operations { @export_subgroup("Visual Nodes") @export var label : Label @export var sprite : Sprite2D +@export var shadow_sprite : Sprite2D @export var sprite_modifier : Sprite2D @export_subgroup("Visual Values") @export var color : Color = Color.BLACK @export var min_scale : float @export var max_scale : float +@export var target_pos : Vector2 + +var size : float = 1 func _ready(): + size = sprite.scale.x + target_pos = position update_visuals() func _process(_delta): - pass + sprite.scale = Vector2(size, size) + shadow_sprite.scale = sprite.scale + +func _physics_process(_delta): + position = position.lerp(target_pos, 0.2) func join_from(node : NumberNode): node.value += self.value @@ -49,7 +59,7 @@ func join_from(node : NumberNode): node.value = roundi(float(node.value) / float(self.modifier)) if modifier_label: modifier_label.pop("/ " + str(self.modifier)) - node.position = self.position + node.target_pos = self.position node.update_visuals() queue_free() -- cgit v1.2.3