-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTutorial.gd
More file actions
73 lines (40 loc) · 1.36 KB
/
Copy pathTutorial.gd
File metadata and controls
73 lines (40 loc) · 1.36 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
extends Node2D
var text
func _ready():
text = get_json()
update_pointer_position(0)
$TutorialGUI/Popup.show()
func get_json():
var file = File.new()
file.open(Global.tutorial_messages, file.READ)
var content = file.get_as_text()
file.close()
return parse_json(content)
func update_pointer_position(number):
var pointer = $ObjectivePointer
var marker = $ObjectiveMarkers.get_child(number)
pointer.position = marker.position
$Tween.interpolate_property(pointer, "position", pointer.position, marker.position,
0.5, Tween.TRANS_SINE, Tween.EASE_IN_OUT)
$Tween.start()
$AudioStreamPlayer.play()
$TutorialGUI/AnimationPlayer.play("Transition")
$TutorialGUI/Popup/NinePatchRect/Label.text = text[str(number)]
func _on_MoveObjective_body_entered(body):
update_pointer_position(1)
func _on_DoorObjective_body_entered(body):
update_pointer_position(3)
func _on_NightVisionObjective_body_entered(body):
update_pointer_position(5)
func _on_ExitObjective_body_entered(body):
update_pointer_position(9)
func _on_Files_body_entered(body):
update_pointer_position(8)
func _on_SuitCase_body_entered(body):
update_pointer_position(6)
func _on_Recorder_body_entered(body):
update_pointer_position(7)
func _on_Lantern_body_entered(body):
update_pointer_position(2)
func _on_RoofObjective2_body_entered(body):
update_pointer_position(4)