1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-29 02:44:19 +00:00
swear-jar/convertors/copper_to_silver.gd
2023-10-02 00:18:57 +02:00

26 lines
474 B
GDScript

extends StaticBody2D
var coda : int = 0
@export var scene: PackedScene
@onready var _animated_sprite = $AnimatedSprite2D
func _on_collector_collected(body):
body.queue_free()
func _on_collector_goal():
coda+=1
func _process(delta):
if coda>=1 and $Timer.is_stopped():
$AnimatedSprite2D.play()
$converter_working.play()
$Timer.start()
func _on_timer_timeout():
coda-=1
$AnimatedSprite2D.stop()
$converter_working.stop()
$New_item.play()
$Spawner.spawn()