-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.tscn
188 lines (156 loc) · 7.24 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
[gd_scene load_steps=19 format=2]
[ext_resource path="res://Blip_Select10.wav" type="AudioStream" id=1]
[ext_resource path="res://ship.png" type="Texture" id=2]
[ext_resource path="res://light.png" type="Texture" id=3]
[ext_resource path="res://Player.gd" type="Script" id=4]
[ext_resource path="res://Water.gd" type="Script" id=5]
[ext_resource path="res://Currents.tres" type="Texture" id=6]
[ext_resource path="res://Chain.gd" type="Script" id=7]
[ext_resource path="res://Level.gd" type="Script" id=8]
[ext_resource path="res://noise.mp3" type="AudioStream" id=9]
[ext_resource path="res://Pickup_Coin29.wav" type="AudioStream" id=10]
[sub_resource type="CircleShape2D" id=12]
radius = 15.702
[sub_resource type="OpenSimplexNoise" id=4]
[sub_resource type="NoiseTexture" id=14]
noise = SubResource( 4 )
[sub_resource type="RectangleShape2D" id=15]
extents = Vector2( 1048.06, 233.71 )
[sub_resource type="Shader" id=11]
code = "shader_type particles;
uniform sampler2D currents;
uniform float width;
uniform float height;
float rand_from_seed(in uint seed) {
int k;
int s = int(seed);
if (s == 0)
s = 305420679;
k = s / 127773;
s = 16807 * (s - k * 127773) - 2836 * k;
if (s < 0)
s += 2147483647;
seed = uint(s);
return float(seed % uint(65536)) / 65535.0;
}
uint hash(uint x) {
x = ((x >> uint(16)) ^ x) * uint(73244475);
x = ((x >> uint(16)) ^ x) * uint(73244475);
x = (x >> uint(16)) ^ x;
return x;
}
void vertex() {
if (RESTART) {
uint alt_seed1 = hash(NUMBER + uint(1) + RANDOM_SEED);
uint alt_seed2 = hash(NUMBER + uint(27) + RANDOM_SEED);
uint alt_seed3 = hash(NUMBER + uint(43) + RANDOM_SEED);
CUSTOM.x = rand_from_seed(alt_seed1);
CUSTOM.y = TIME;
vec3 position = vec3((rand_from_seed(alt_seed2) * 2.0 - 1.0) * width,
(rand_from_seed(alt_seed3) * 2.0 - 1.0) * height,
0);
TRANSFORM[3].xyz = position;
COLOR.a = 0.0;
} else {
vec4 col = texture(currents, vec2((TRANSFORM[3].x/width + 1.0) / 2.0, (TRANSFORM[3].y/height + 1.0) / 2.0));
VELOCITY.x = (col.x-0.5)*100.0;
float t = clamp((TIME - CUSTOM.y)/LIFETIME, 0.0, 1.0);
float t2 = clamp(t*10.0, 0.0, 1.0);
COLOR.a = (1.0 - t)*t2;
}
}"
[sub_resource type="ShaderMaterial" id=16]
shader = SubResource( 11 )
shader_param/width = 100.0
shader_param/height = 100.0
shader_param/currents = ExtResource( 6 )
[sub_resource type="OpenSimplexNoise" id=17]
octaves = 4
[sub_resource type="NoiseTexture" id=18]
width = 1024
height = 1024
seamless = true
noise = SubResource( 17 )
[node name="Game" type="Node2D"]
[node name="Player" type="RigidBody2D" parent="."]
position = Vector2( 230.741, 148.46 )
collision_layer = 1537
mass = 10.0
can_sleep = false
linear_damp = 2.215
angular_damp = 21.419
script = ExtResource( 4 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
shape = SubResource( 12 )
[node name="Camera2D" type="Camera2D" parent="Player"]
position = Vector2( 0, 50 )
current = true
zoom = Vector2( 0.33, 0.33 )
smoothing_enabled = true
smoothing_speed = 2.0
[node name="Sprite" type="Sprite" parent="Player"]
position = Vector2( 0, -9.873 )
scale = Vector2( 0.2, 0.2 )
texture = ExtResource( 2 )
[node name="Chain" type="Node2D" parent="Player"]
position = Vector2( -45, -10 )
script = ExtResource( 7 )
[node name="Light2D" type="Light2D" parent="Player"]
position = Vector2( 39.3051, -2.9583 )
scale = Vector2( 0.100925, 0.102306 )
texture = ExtResource( 3 )
color = Color( 1, 0.917647, 0.639216, 1 )
energy = 0.42
[node name="Light2D2" type="Light2D" parent="Player"]
position = Vector2( -28.6511, -4.50342 )
scale = Vector2( 0.139698, 0.124087 )
texture = ExtResource( 3 )
color = Color( 1, 0.886275, 0.694118, 1 )
energy = 0.44
[node name="SonarPing" type="AudioStreamPlayer2D" parent="Player"]
stream = ExtResource( 1 )
[node name="Level" type="StaticBody2D" parent="."]
collision_mask = 5
script = ExtResource( 8 )
[node name="CollectSound" type="AudioStreamPlayer" parent="Level"]
stream = ExtResource( 10 )
volume_db = -3.939
[node name="BackgroundNoise" type="AudioStreamPlayer" parent="Level"]
stream = ExtResource( 9 )
volume_db = -15.757
autoplay = true
[node name="WaterArea" type="Area2D" parent="Level"]
collision_mask = 512
script = ExtResource( 5 )
texture = SubResource( 14 )
color = Color( 0.278431, 0.678431, 1, 0.662745 )
currents = ExtResource( 6 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Level/WaterArea"]
position = Vector2( 1049.82, 411.434 )
shape = SubResource( 15 )
[node name="Particles2D" type="Particles2D" parent="Level/WaterArea"]
position = Vector2( 1050.46, 412.221 )
amount = 2000
lifetime = 5.0
preprocess = 5.0
process_material = SubResource( 16 )
[node name="Polygon2D" type="Polygon2D" parent="Level"]
position = Vector2( 83.0141, 199.209 )
scale = Vector2( 1.08553, 1.04479 )
color = Color( 0.55, 0.249333, 0.099, 1 )
texture = SubResource( 18 )
polygon = PoolVector2Array( 10.7176, -61.6618, 72.1483, -31.6956, 103.613, 34.2299, 132.081, 109.145, 215.986, 76.1825, 256.44, 110.644, 275.918, 178.067, 278.915, 170.576, 355.328, 89.6673, 419.755, 128.623, 443.728, 178.067, 470.698, 112.142, 532.129, 152.596, 563.593, 212.528, 581.573, 221.518, 634.013, 172.074, 658.76, 249.847, 687.064, 324.886, 734.887, 367.476, 768.071, 212.327, 768.861, 142.108, 798.827, 166.081, 813.81, 101.654, 840.78, 143.606, 843.776, 80.6774, 865.514, 98.961, 916.421, 311.703, 940.569, 356.157, 996.451, 386.743, 1030.61, 266.072, 1100.88, 362.406, 1178.99, 275.198, 1179.97, 378.63, 1268.78, 315.76, 1322.46, 314.746, 1351.74, 290.409, 1350.77, 343.139, 1319.54, 389.785, 1439.58, 381.673, 1531.35, 228.532, 1493.33, 169.277, 1597.15, 105.464, 1579.61, 261.957, 1632.83, 356.322, 1784.99, 400.939, 1799.63, 3.43417, 1837.64, -81.4155, 2001.42, -79.8962, 2004.34, 565.827, -75.9321, 564.308, -76.1842, -52.6719 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Level"]
visible = false
position = Vector2( 83.0141, 199.209 )
scale = Vector2( 1.08553, 1.04479 )
polygon = PoolVector2Array( 10.7176, -61.6618, 72.1483, -31.6956, 103.613, 34.2299, 132.081, 109.145, 215.986, 76.1825, 256.44, 110.644, 275.918, 178.067, 278.915, 170.576, 355.328, 89.6673, 419.755, 128.623, 443.728, 178.067, 470.698, 112.142, 532.129, 152.596, 563.593, 212.528, 581.573, 221.518, 634.013, 172.074, 658.76, 249.847, 687.064, 324.886, 734.887, 367.476, 768.071, 212.327, 768.861, 142.108, 798.827, 166.081, 813.81, 101.654, 840.78, 143.606, 843.776, 80.6774, 865.514, 98.961, 916.421, 311.703, 940.569, 356.157, 996.451, 386.743, 1030.61, 266.072, 1100.88, 362.406, 1178.99, 275.198, 1179.97, 378.63, 1268.78, 315.76, 1322.46, 314.746, 1351.74, 290.409, 1350.77, 343.139, 1319.54, 389.785, 1439.58, 381.673, 1531.35, 228.532, 1493.33, 169.277, 1597.15, 105.464, 1579.61, 261.957, 1632.83, 356.322, 1784.99, 400.939, 1799.63, 3.43417, 1837.64, -81.4155, 2001.42, -79.8962, 2004.34, 565.827, -75.9321, 564.308, -76.1842, -52.6719 )
__meta__ = {
"_editor_description_": ""
}
[node name="Timer" type="Timer" parent="Level"]
wait_time = 0.5
autostart = true
[connection signal="body_entered" from="Level/WaterArea" to="Level/WaterArea" method="_on_Area2D_body_entered"]
[connection signal="body_exited" from="Level/WaterArea" to="Level/WaterArea" method="_on_Area2D_body_exited"]
[connection signal="timeout" from="Level/Timer" to="Level" method="_on_Timer_timeout"]