Skip to content

Commit

Permalink
overhearing box added
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy260700 committed Jan 5, 2021
1 parent a5c384c commit 137e5c4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
9 changes: 6 additions & 3 deletions resources/speaking_characters/group 2.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extends StaticBody2D

signal hear(value)
signal hear
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
Expand All @@ -16,5 +16,8 @@ func _ready():
# pass


func _on_Area2D_body_entered(body,value):
emit_signal('hear',value)
func _on_Area2D_body_entered(body):
print(body)
if body != self:
emit_signal('hear')

1 change: 1 addition & 0 deletions scenes/Over_hearing.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func _on_Button_button_down() -> void:
process_state(state)
else:
system.set_visible(false)
index=0
emit_signal("completed")

func start() -> void:
Expand Down
5 changes: 5 additions & 0 deletions scenes/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ func _ready():
func _on_initial_story_completed():
system_main.set_dialogue_file_path ("res://resources/dialogue/obj1.json")
system_main.start()


func _on_Node2D2_hear():
$Over_hearing.set_dialogue_file_path("res://resources/dialogue/overheard_1.json")
$Over_hearing.start()
3 changes: 2 additions & 1 deletion scenes/main.tscn

Large diffs are not rendered by default.

0 comments on commit 137e5c4

Please sign in to comment.