changed structure to make musician scenes inherit a common parent
This commit is contained in:
1 parent
06dc6d63b6
commit
158339d042
21 files changed
+397
-391
No files matched your search
@@ -1,23 +0,0 @@
|
||||
#@tool
|
||||
#@icon(icon_path: String)
|
||||
class_name Conductor
|
||||
extends Musician
|
||||
## Documentation comments
|
||||
|
||||
## signal
|
||||
## enum
|
||||
## const
|
||||
## @export var
|
||||
## var
|
||||
## @onready var
|
||||
|
||||
## OVERRIDES
|
||||
|
||||
|
||||
## CORE
|
||||
|
||||
## PRIVATE/HELPER
|
||||
|
||||
## RECEIVERS
|
||||
|
||||
## SETTERS/GETTERS
|
||||
@@ -1 +0,0 @@
|
||||
uid://dppf0pasfnksi
|
||||
+4
-4
@@ -8,10 +8,10 @@ extends Node2D
|
||||
## enum
|
||||
## const
|
||||
|
||||
@onready var conductor: Conductor = %Conductor
|
||||
@onready var violinist: Musician = %Viol
|
||||
@onready var cellist: Musician = %Cello
|
||||
@onready var bassist: Musician = %Bass
|
||||
@onready var conductor: Musician = %Conductor
|
||||
@onready var violinist: Musician = %Violinist
|
||||
@onready var cellist: Musician = %Cellist
|
||||
@onready var bassist: Musician = %Bassist
|
||||
#@onready var rhythm_manager: RhythmManager = %RhythmManager
|
||||
#@onready var click_track: AudioStreamPlayer2D = %ClickTrack
|
||||
@onready var canvas_modulate: CanvasModulate = $CanvasModulate
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#@tool
|
||||
#@icon(icon_path: String)
|
||||
class_name Musician
|
||||
extends AnimatedSprite2D
|
||||
## Documentation comments
|
||||
|
||||
# signal
|
||||
# enum
|
||||
#const
|
||||
|
||||
@export_group("Input Textures")
|
||||
@export var solid_texture: Texture2D
|
||||
@export var outline_texture: Texture2D
|
||||
|
||||
var is_active: bool = false
|
||||
|
||||
@onready var audio: AudioStreamPlayer2D = %Audio
|
||||
@onready var light: PointLight2D = %Light
|
||||
@onready var occluder: LightOccluder2D = %Occluder
|
||||
@onready var input_prompt: Sprite2D = %InputPrompt
|
||||
|
||||
## OVERRIDES
|
||||
|
||||
func _ready() -> void:
|
||||
light.visible = false
|
||||
audio.connect("finished", enter_exit)
|
||||
input_prompt.texture = outline_texture
|
||||
audio.volume_db = -100.0
|
||||
is_active = true
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
pass
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
pass
|
||||
|
||||
## CORE
|
||||
func enter_exit() -> void:
|
||||
if is_active:
|
||||
play("idle")
|
||||
#audio.stop()
|
||||
audio.volume_db = -100.0
|
||||
light.visible = false
|
||||
is_active = false
|
||||
input_prompt.texture = outline_texture
|
||||
else:
|
||||
play("default")
|
||||
#audio.play()
|
||||
audio.volume_db = 0.0
|
||||
light.visible = true
|
||||
is_active = true
|
||||
input_prompt.texture = solid_texture
|
||||
|
||||
## PRIVATE/HELPER
|
||||
|
||||
## RECEIVERS
|
||||
|
||||
## SETTERS/GETTERS
|
||||
@@ -0,0 +1 @@
|
||||
uid://djmn4qgj45j2p
|
||||
Reference in new issue
Block a user