extends Node2D

@onready var on: Sprite2D = $CaraFeliz
@onready var powerless: Sprite2D = $CaraTieso
@onready var off: Sprite2D = $CaraPanico


@export var game_manager: GameManager
var lights_out: bool


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	if abs(game_manager.spinner_speed) > 0:
		_on_face()
		lights_out = false
	elif not lights_out:
		_powerless_face()


func _on_lights_out():
	lights_out = true
	_off_face()


func _on_face():
	on.visible = true
	powerless.visible = false
	off.visible = false


func _off_face():
	on.visible = false
	powerless.visible = false
	off.visible = true


func _powerless_face():
	on.visible = false
	powerless.visible = true
	off.visible = false
