-
Notifications
You must be signed in to change notification settings - Fork 0
/
cutscenes.gd
77 lines (53 loc) · 1.37 KB
/
cutscenes.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
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
74
75
76
77
extends CanvasLayer
signal keypress
onready var beginanim = $beginanim
onready var endanim = $endanim
onready var base = get_node("/root/base")
var cur = 0
# Called when the node enters the scene tree for the first time.
func _ready():
$end.visible = false
func open_cutscene():
visible = true
$menu.visible = true
beginanim.play("start")
yield(self, "keypress")
base.fade.play("fade")
yield(base.fade, "animation_finished")
$menu.visible = false
base.fade.play_backwards("fade")
while cur < 5:
beginanim.play(str(cur))
cur += 1
yield(get_tree().create_timer(0.1), "timeout")
yield(self, "keypress")
if cur == 5:
base.fade.play("fade")
yield(base.fade, "animation_finished")
visible = false
beginanim.stop()
base.state = "play"
base.fade.play_backwards("fade")
func end_cutscene():
base.fade.play("fade")
yield(base.fade, "animation_finished")
visible = true
endanim.play("0")
base.state = "listen"
base.fade.play_backwards("fade")
yield(base.fade, "animation_finished")
yield(self, "keypress")
cur = 1
while cur < 3:
endanim.play(str(cur))
cur += 1
yield(get_tree().create_timer(0.1), "timeout")
yield(self, "keypress")
if cur == 3:
pass
func _input(event):
if event is InputEventKey:
if event.pressed:
emit_signal("keypress")
if Input.is_action_just_pressed("click"):
emit_signal("keypress")