Files
godot-4-key-rhythm-game/rhythm_game/note/visual/note_visual.gd
2026-02-01 23:14:52 +08:00

23 lines
403 B
GDScript

@abstract class_name NoteVisual extends Node2D
enum TYPE {
TAP = 0,
HOLD = 1
}
@abstract func reset() -> void
@abstract func in_use() -> bool
@abstract func update(beat: float) -> void
# ======= IMPLEMENTATION ======= #
var _lane: Lane = null
func _notification(what: int) -> void:
match what:
NOTIFICATION_PARENTED:
_lane = get_parent() as Lane
NOTIFICATION_UNPARENTED:
_lane = null