diff options
author | altaf-creator <dev@altafcreator.com> | 2024-04-14 23:35:47 +0700 |
---|---|---|
committer | altaf-creator <dev@altafcreator.com> | 2024-04-14 23:35:47 +0700 |
commit | e730e2188eda08bf84fea7335dc2c0f3b5551509 (patch) | |
tree | d2a02222cfbec496081059fa27b06466aa9674b3 /Scripts | |
parent | f1b4d6034c937c89b2750bc209684a4e19896177 (diff) |
i want to sign off
Diffstat (limited to 'Scripts')
-rw-r--r-- | Scripts/NumberNode.gd | 11 |
1 files changed, 8 insertions, 3 deletions
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(): |