extends CPUParticles2D

@export var speed: float = 600.0

func _physics_process(delta: float) -> void:
	position += transform.x * speed * delta

func set_from_player(val):
	$Hitbox.from_player = val

func _on_hitbox_collided() -> void:
	$Hitbox.queue_free()
	$Explosion.emitting = true
	emitting = false
	await get_tree().create_timer(1.2).timeout
	queue_free()


func _on_timer_timeout() -> void:
	queue_free()
