-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.tscn
299 lines (233 loc) · 8.29 KB
/
Game.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
[gd_scene load_steps=25 format=2]
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://Art/WhitePixel.png" type="Texture" id=2]
[ext_resource path="res://PlatformCollider.tscn" type="PackedScene" id=3]
[ext_resource path="res://Spawner.tscn" type="PackedScene" id=4]
[ext_resource path="res://Art/SunRay.png" type="Texture" id=5]
[ext_resource path="res://Art/Sun.png" type="Texture" id=6]
[ext_resource path="res://Art/Umbrella.png" type="Texture" id=7]
[ext_resource path="res://Art/SandFloor.png" type="Texture" id=8]
[ext_resource path="res://Art/ParallaxBackground.png" type="Texture" id=9]
[ext_resource path="res://Art/Player1.png" type="Texture" id=10]
[ext_resource path="res://Art/Player2.png" type="Texture" id=11]
[ext_resource path="res://Sound/Running_at_the_Sun.mp3" type="AudioStream" id=12]
[sub_resource type="GDScript" id=2]
resource_name = "PlayerTracker"
script/source = "extends Node2D
onready var _player = get_node(\"../Player\")
func _process(delta):
self.position = Vector2(0, _player.position.y)
"
[sub_resource type="AnimatedTexture" id=3]
[sub_resource type="GDScript" id=9]
resource_name = "ProgressBar"
script/source = "extends Sprite
const start : Vector2 = Vector2(-428,245)
const end : Vector2 = Vector2(-428,-195)
onready var player = get_node(\"../../Player\")
func _ready():
$ManHUD.play(\"ManRun\")
$SunHUD.play(\"SunRotate\")
# print(\"akdgbakjbg\");
func _process(delta):
self.position = lerp(start, end, player.distance / player.END_DISTANCE)
"
[sub_resource type="Animation" id=10]
resource_name = "ManRun"
length = 0.6
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ ExtResource( 10 ), ExtResource( 11 ) ]
}
[sub_resource type="Animation" id=11]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath(".:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ ExtResource( 10 ) ]
}
[sub_resource type="Animation" id=12]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("../Sun/Rays:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0.0 ]
}
[sub_resource type="Animation" id=13]
resource_name = "SunRotate"
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("../Sun/Rays:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 0.0, 360.0 ]
}
[sub_resource type="GDScript" id=8]
script/source = "extends Label
onready var player = get_node(\"../../Player\");
func _process(delta):
if player.distance < player.END_DISTANCE:
GlobalTimer.time += delta
var mils = fmod(GlobalTimer.time,1)*1000
var secs = fmod(GlobalTimer.time,60)
var mins = fmod(GlobalTimer.time, 60*60) / 60
var hr = fmod(fmod(GlobalTimer.time,3600 * 60) / 3600,24)
var time_passed = \"%02d : %02d : %02d : %03d\" % [hr,mins,secs,mils]
text = time_passed# + \" : \" + var2str(time)
pass
"
[sub_resource type="GDScript" id=4]
script/source = "extends Sprite
onready var _player = get_node(\"../../../Player\")
func _process(delta):
self.modulate = lerp(Color(\"72fffe\"), Color.black, min(_player.distance / 30000, 1))
pass
"
[sub_resource type="GDScript" id=7]
script/source = "extends Sprite
onready var _player = get_node(\"../../../../Player\")
func _process(delta):
self.modulate = lerp(Color.transparent, Color.white, min(float(_player.distance > 10000), min(_player.distance / 45000, 1)) )
pass
"
[sub_resource type="GDScript" id=6]
resource_name = "Despawner"
script/source = "extends Area2D
# Declare member variables here. Examples:
# var a = 2
# var b = \"text\"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Despawner_area_entered(area):
area.queue_free()
func _on_Despawner_body_entered(body):
body.get_parent().queue_free()
"
[sub_resource type="RectangleShape2D" id=5]
extents = Vector2( 391.5, 52 )
[node name="Node2D" type="Node2D"]
[node name="PlayerTracker" type="Node2D" parent="."]
script = SubResource( 2 )
[node name="LeftMargin" type="Sprite" parent="PlayerTracker"]
self_modulate = Color( 0.372549, 0.372549, 0.372549, 1 )
position = Vector2( -426, 0 )
scale = Vector2( 171.537, 604.775 )
texture = ExtResource( 2 )
normal_map = SubResource( 3 )
[node name="StaticBody2D" parent="PlayerTracker/LeftMargin" instance=ExtResource( 3 )]
visible = false
scale = Vector2( 0.0497176, 0.049926 )
collision_layer = 16
[node name="Sun" type="Sprite" parent="PlayerTracker"]
position = Vector2( -431, -229 )
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 6 )
[node name="Rays" type="Sprite" parent="PlayerTracker/Sun"]
texture = ExtResource( 5 )
[node name="Man" type="Sprite" parent="PlayerTracker"]
position = Vector2( -428, 245 )
rotation = -1.5708
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 10 )
script = SubResource( 9 )
[node name="ManHUD" type="AnimationPlayer" parent="PlayerTracker/Man"]
anims/ManRun = SubResource( 10 )
anims/RESET = SubResource( 11 )
[node name="SunHUD" type="AnimationPlayer" parent="PlayerTracker/Man"]
anims/RESET = SubResource( 12 )
anims/SunRotate = SubResource( 13 )
[node name="RightMargin" type="Sprite" parent="PlayerTracker"]
modulate = Color( 0.372549, 0.372549, 0.372549, 1 )
position = Vector2( 429, 0 )
scale = Vector2( 172, 600 )
texture = ExtResource( 2 )
[node name="StaticBody2D" parent="PlayerTracker/RightMargin" instance=ExtResource( 3 )]
visible = false
scale = Vector2( 0.0497176, 0.0499259 )
collision_layer = 16
[node name="Spawner" parent="PlayerTracker" instance=ExtResource( 4 )]
[node name="Time" type="Label" parent="PlayerTracker"]
margin_left = 351.0
margin_top = 224.0
margin_right = 496.0
margin_bottom = 277.0
text = "\"00:00:00\""
script = SubResource( 8 )
[node name="ParallaxBackground" type="ParallaxBackground" parent="PlayerTracker"]
layer = -1
[node name="Background" type="Sprite" parent="PlayerTracker/ParallaxBackground"]
modulate = Color( 0.447059, 1, 0.996078, 1 )
position = Vector2( 519, 302 )
scale = Vector2( 765, 604 )
texture = ExtResource( 2 )
script = SubResource( 4 )
[node name="ParallaxLayer" type="ParallaxLayer" parent="PlayerTracker/ParallaxBackground"]
motion_mirroring = Vector2( 0, 1000 )
[node name="Sprite" type="Sprite" parent="PlayerTracker/ParallaxBackground/ParallaxLayer"]
texture = ExtResource( 9 )
script = SubResource( 7 )
[node name="Despawner" type="Area2D" parent="PlayerTracker"]
position = Vector2( 4, 476 )
collision_layer = 0
collision_mask = 6
script = SubResource( 6 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerTracker/Despawner"]
position = Vector2( 0, 311 )
shape = SubResource( 5 )
[node name="Props" type="Node2D" parent="."]
[node name="Sand" type="Sprite" parent="Props"]
position = Vector2( 2, 170 )
scale = Vector2( 0.680002, 0.4 )
texture = ExtResource( 8 )
[node name="Umbrella" type="Sprite" parent="Props"]
position = Vector2( 145, 247 )
scale = Vector2( 0.140271, 0.140271 )
texture = ExtResource( 7 )
[node name="Sun" type="Sprite" parent="Props"]
position = Vector2( 0, -100100 )
scale = Vector2( 0.661911, 0.661911 )
texture = ExtResource( 6 )
[node name="Sprite" type="Sprite" parent="Props/Sun"]
texture = ExtResource( 5 )
[node name="Player" parent="." instance=ExtResource( 1 )]
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 12 )
volume_db = -7.0
autoplay = true
max_distance = 150000.0
attenuation = 0.0717937
[connection signal="area_entered" from="PlayerTracker/Despawner" to="PlayerTracker/Despawner" method="_on_Despawner_area_entered"]
[connection signal="body_entered" from="PlayerTracker/Despawner" to="PlayerTracker/Despawner" method="_on_Despawner_body_entered"]