2023-10-01 19:58:40 +00:00
|
|
|
extends StaticBody2D
|
|
|
|
|
2023-10-01 22:18:57 +00:00
|
|
|
var coda : int = 0
|
|
|
|
|
2023-10-01 19:58:40 +00:00
|
|
|
@export var scene: PackedScene
|
|
|
|
|
2023-10-01 21:27:05 +00:00
|
|
|
@onready var _animated_sprite = $AnimatedSprite2D
|
|
|
|
|
2023-10-01 19:58:40 +00:00
|
|
|
func _on_collector_collected(body):
|
|
|
|
body.queue_free()
|
|
|
|
|
|
|
|
func _on_collector_goal():
|
2023-10-01 22:18:57 +00:00
|
|
|
coda+=1
|
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
if coda>=1 and $Timer.is_stopped():
|
|
|
|
$AnimatedSprite2D.play()
|
|
|
|
$converter_working.play()
|
|
|
|
$Timer.start()
|
2023-10-01 21:27:05 +00:00
|
|
|
|
|
|
|
func _on_timer_timeout():
|
2023-10-01 22:18:57 +00:00
|
|
|
coda-=1
|
2023-10-01 21:27:05 +00:00
|
|
|
$AnimatedSprite2D.stop()
|
2023-10-01 21:44:40 +00:00
|
|
|
$converter_working.stop()
|
|
|
|
$New_item.play()
|
2023-10-01 20:36:26 +00:00
|
|
|
$Spawner.spawn()
|