-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit1House.gd
33 lines (25 loc) · 880 Bytes
/
Unit1House.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
extends Area2D
var active = false
# Called when the node enters the scene tree for the first time.
func _ready():
connect("body_entered", self, '_on_sign_body_entered')
connect("body_exited", self, '_on_sign_body_exited')
func _process(delta):
$QuestionMark.visible = active
func _input(event):
if get_node_or_null('DialogNode') == null:
if event.is_action_pressed("ui_accept") and active:
get_tree().paused = true
var dialog = Dialogic.start('Unit1House')
dialog.pause_mode = Node.PAUSE_MODE_PROCESS
dialog.connect('timeline_end', self, 'unpause')
add_child(dialog)
func unpause(_timeline_name):
get_tree().paused = false
get_tree().change_scene("res://Unit1Jerusalem.tscn")
func _on_sign_body_entered(body):
if body.name == 'Player':
active = true
func _on_sign_body_exited(body):
if body.name == 'Player':
active = false