-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCinematic.tscn
121 lines (99 loc) · 3.13 KB
/
Cinematic.tscn
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Assets/Audio/cinematicIntro.wav" type="AudioStream" id=1]
[ext_resource path="res://Assets/bg.png" type="Texture" id=2]
[ext_resource path="res://Assets/cinematic/cinematicExp.png" type="Texture" id=3]
[ext_resource path="res://ScreenShake.tscn" type="PackedScene" id=4]
[sub_resource type="GDScript" id=1]
script/source = "extends Node2D
var initial_scale = Vector2(2.12, 1.0)
var final_scale = Vector2(0.0, 0.0)
signal cinematic_done
signal spawn_ship
# Called when the node enters the scene tree for the first time.
func _ready():
$Timer.connect(\"timeout\", self, \"shake_pod\")
$Timer2.connect(\"timeout\", self, \"switch_to_frame3\")
$Timer3.connect(\"timeout\", self, \"zoom_out\")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is_action_pressed(\"ui_accept\"):
emit_signal(\"cinematic_done\")
func shake_pod():
$ScreenShake.queue_shake()
switch_to_frame2()
# $ScreenShake.connect(\"shake_done\", self, \"switch_to_frame2\")
func switch_to_frame2():
$Pod.frame = 1
$Timer2.start()
func switch_to_frame3():
$Pod.frame = 2
$Timer3.start()
func zoom_out():
emit_signal(\"spawn_ship\")
$AnimationPlayer.play(\"zoom_out\")
$AnimationPlayer.connect(\"animation_finished\", self, \"cinematic_complete\")
func cinematic_complete(animation_name):
print(\"Cinematic done\")
emit_signal(\"cinematic_done\")
"
[sub_resource type="Animation" id=2]
resource_name = "zoom_out"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath(".:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 2.37841, 1 ),
"update": 0,
"values": [ Vector2( 2.12, 1 ), Vector2( 0, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 3.605 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 480, 270 ) ]
}
[node name="Cinematic" type="Node2D"]
script = SubResource( 1 )
[node name="Timer" type="Timer" parent="."]
wait_time = 4.5
one_shot = true
autostart = true
[node name="Timer2" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[node name="Timer3" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 1 )
autoplay = true
bus = "Music"
[node name="Background" type="Sprite" parent="."]
scale = Vector2( 2, 2 )
texture = ExtResource( 2 )
centered = false
[node name="Pod" type="Sprite" parent="."]
scale = Vector2( 2.12, 1 )
texture = ExtResource( 3 )
centered = false
hframes = 3
[node name="ScreenShake" parent="." instance=ExtResource( 4 )]
shake_node = NodePath("../Pod")
position_property = "position"
shake_times = 10
shake_strength = 40.0
[node name="Tween" type="Tween" parent="."]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
root_node = NodePath("../Pod")
anims/zoom_out = SubResource( 2 )