From e730e2188eda08bf84fea7335dc2c0f3b5551509 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 14 Apr 2024 23:35:47 +0700 Subject: i want to sign off --- Scripts/NumberNode.gd | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Scripts') diff --git a/Scripts/NumberNode.gd b/Scripts/NumberNode.gd index 016a83c..b81481a 100644 --- a/Scripts/NumberNode.gd +++ b/Scripts/NumberNode.gd @@ -34,13 +34,15 @@ func _ready(): target_pos = position update_visuals() -func _process(_delta): - sprite.scale = Vector2(size, size) - shadow_sprite.scale = sprite.scale +#func _process(_delta): func _physics_process(_delta): position = position.lerp(target_pos, 0.2) + if sqrt(((target_pos.x - position.x) * (target_pos.x - position.x) + (target_pos.y - position.y) * (target_pos.y - position.y))) < 15: # distance tolerance + sprite.scale = sprite.scale.lerp(Vector2(size, size), 0.2) + shadow_sprite.scale = sprite.scale + func join_from(node : NumberNode): node.value += self.value @@ -78,6 +80,9 @@ func update_visuals(): sprite_modifier.visible = true if self.modifier_operation == Operations.NONE: sprite_modifier.visible = false + + if self.value < 0: + sprite.modulate.a = 0.5 ## @deprecated func softlock_check(): -- cgit v1.2.3