extends Area2D

func _ready() -> void:
  EventBus.heart_beat.connect(_on_heart_beat)
  

func _on_heart_beat(tempo: float):
  if tempo == 0:
    $AnimationPlayer.stop()
    var tween = create_tween().set_trans(Tween.TRANS_LINEAR)
    tween.tween_property(self,  "modulate",Color(0,0,0), 2.5)
  elif tempo > 0:
    $AnimationPlayer.set_speed_scale(tempo)
    
