Workers, lighting, and loading

This commit is contained in:
2020-05-16 17:05:44 -04:00
parent 7528cba7d7
commit a26da07f43
61 changed files with 905 additions and 24 deletions

View File

@ -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):

View 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)

View 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

View File

@ -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)