Workers, lighting, and loading
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
extends Area2D
|
||||
|
||||
signal interacted
|
||||
var player
|
||||
|
||||
func _ready():
|
||||
connect("body_entered", self, "_on_body_enter")
|
||||
@ -8,6 +9,7 @@ func _ready():
|
||||
|
||||
func _on_body_enter(body):
|
||||
if body.has_method("add_interactable"):
|
||||
player = body
|
||||
body.add_interactable(self)
|
||||
|
||||
func _on_body_exit(body):
|
||||
|
9
client/Scripts/Component/InteractableDialog.gd
Normal file
9
client/Scripts/Component/InteractableDialog.gd
Normal file
@ -0,0 +1,9 @@
|
||||
extends "res://Scripts/Component/Interactable.gd"
|
||||
|
||||
export var dialog_name : String = "unconfigured"
|
||||
|
||||
func _ready():
|
||||
connect("interacted", self, "_on_interact")
|
||||
|
||||
func _on_interact():
|
||||
$Speaker.start_dialog(dialog_name)
|
14
client/Scripts/Component/LightLoader.gd
Normal file
14
client/Scripts/Component/LightLoader.gd
Normal file
@ -0,0 +1,14 @@
|
||||
extends Area2D
|
||||
|
||||
func _ready():
|
||||
connect("body_entered", self, "_on_body_enter")
|
||||
connect("body_exited", self, "_on_body_exit")
|
||||
get_parent().get_node("Light2D").enabled = false
|
||||
|
||||
func _on_body_enter(body):
|
||||
if body.has_method("add_interactable"):
|
||||
get_parent().get_node("Light2D").enabled = true
|
||||
|
||||
func _on_body_exit(body):
|
||||
if body.has_method("remove_interactable"):
|
||||
get_parent().get_node("Light2D").enabled = false
|
@ -83,5 +83,4 @@ func move_dialog_forward(decision = 0):
|
||||
|
||||
func _process(delta):
|
||||
if(Input.is_action_just_pressed("ui_accept") and choices == 0 and final_display_message == gui.current_dialog()):
|
||||
print("YEET")
|
||||
move_dialog_forward(0)
|
||||
|
Reference in New Issue
Block a user