Star.gd 407 B

12345678910111213141516171819202122
  1. extends PathFollow2D
  2. # a moving music player
  3. signal note_changed(new_note: Music.Note, octave: int)
  4. const RAYON = 20
  5. @export var speed: float = 200.0
  6. @export var note: Music.Note = Music.Note.A
  7. @export var octave: int = 0
  8. func _ready():
  9. emit_signal("note_changed", note, octave)
  10. func _physics_process(delta):
  11. progress += speed * delta
  12. func _draw():
  13. draw_circle(Vector2.ZERO, RAYON, Color.WHITE)