Update note visuals.
This commit is contained in:
@@ -1,4 +1,18 @@
|
|||||||
class_name HoldNote extends NoteVisual
|
class_name HoldNote extends NoteVisual
|
||||||
|
|
||||||
|
@export var start: Node2D
|
||||||
|
|
||||||
|
@export var end: Node2D
|
||||||
|
|
||||||
var start_id: int
|
var start_id: int
|
||||||
var end_id: int
|
var end_id: int
|
||||||
|
|
||||||
|
func reset() -> void:
|
||||||
|
start_id = -1
|
||||||
|
end_id = -1
|
||||||
|
|
||||||
|
func in_use() -> bool:
|
||||||
|
return start_id >= 0 or end_id >= 0
|
||||||
|
|
||||||
|
func update(beat: float) -> void:
|
||||||
|
pass
|
||||||
|
|||||||
@@ -1,3 +1,39 @@
|
|||||||
[gd_scene format=3 uid="uid://dq5ocf0272tet"]
|
[gd_scene format=3 uid="uid://dq5ocf0272tet"]
|
||||||
|
|
||||||
[node name="HoldNote" type="Node2D" unique_id=495232990]
|
[ext_resource type="Script" uid="uid://cbsnb8bdby0d" path="res://rhythm_game/note/visual/hold/hold_note.gd" id="1_5cv34"]
|
||||||
|
|
||||||
|
[node name="HoldNote" type="Node2D" unique_id=320259211]
|
||||||
|
script = ExtResource("1_5cv34")
|
||||||
|
metadata/_custom_type_script = "uid://cbsnb8bdby0d"
|
||||||
|
|
||||||
|
[node name="NoteStart" type="Node2D" parent="." unique_id=1911676927]
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="NoteStart" unique_id=1232591431]
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -29.0
|
||||||
|
offset_top = -6.0
|
||||||
|
offset_right = 29.0
|
||||||
|
offset_bottom = 6.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
color = Color(0.93, 0, 0, 1)
|
||||||
|
|
||||||
|
[node name="NoteEnd" type="Node2D" parent="." unique_id=2007025807]
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="NoteEnd" unique_id=1179831333]
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -29.0
|
||||||
|
offset_top = -6.0
|
||||||
|
offset_right = 29.0
|
||||||
|
offset_bottom = 6.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
color = Color(0.93, 0, 0, 1)
|
||||||
|
|||||||
@@ -8,3 +8,15 @@ enum TYPE {
|
|||||||
@abstract func reset() -> void
|
@abstract func reset() -> void
|
||||||
|
|
||||||
@abstract func in_use() -> bool
|
@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
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ class_name TapNote extends NoteVisual
|
|||||||
|
|
||||||
var id: int = -1
|
var id: int = -1
|
||||||
|
|
||||||
|
#TODO: Add all the members needed so a note can be updated.
|
||||||
|
|
||||||
func reset() -> void:
|
func reset() -> void:
|
||||||
id = -1
|
id = -1
|
||||||
|
|
||||||
func in_use() -> bool:
|
func in_use() -> bool:
|
||||||
return id >= 0
|
return id >= 0
|
||||||
|
|
||||||
|
func update(beat: float) -> void:
|
||||||
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user