small racing game im working on
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
[gd_scene load_steps=16 format=3 uid="uid://cr1mgp6bgxh64"]

[ext_resource type="Theme" uid="uid://d3ywcokn5ddy8" path="res://ui/theme.tres" id="1_aykd4"]
[ext_resource type="Script" path="res://ui/finish.gd" id="1_crs2w"]
[ext_resource type="Script" path="res://ui/diff.gd" id="2_gtres"]
[ext_resource type="SystemFont" uid="uid://d2klp6vxh5l2d" path="res://ui/cascadiabold.tres" id="3_qktla"]
[ext_resource type="StyleBox" uid="uid://bxi4jeh5lf468" path="res://ui/assets/wide_button_focus.stylebox" id="4_dck0l"]
[ext_resource type="SystemFont" uid="uid://bkjqtc5i64r3j" path="res://ui/ubuntu.tres" id="5_llemr"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bgqa0"]
bg_color = Color(0, 0.168627, 0.211765, 1)
corner_radius_top_left = 100
corner_radius_top_right = 100
corner_radius_bottom_right = 100
corner_radius_bottom_left = 100
anti_aliasing = false

[sub_resource type="LabelSettings" id="LabelSettings_f3a8x"]
line_spacing = 0.0
font_size = 200
font_color = Color(0.933333, 0.909804, 0.835294, 1)
outline_size = 25
outline_color = Color(0.25098, 0.25098, 0.25098, 1)
shadow_size = 20
shadow_color = Color(0, 0, 0, 0.392157)
shadow_offset = Vector2(10, 10)

[sub_resource type="LabelSettings" id="LabelSettings_m62vt"]
font = ExtResource("3_qktla")
font_size = 100
font_color = Color(0.992157, 0.964706, 0.890196, 1)
shadow_size = 20
shadow_color = Color(0, 0, 0, 0.27451)
shadow_offset = Vector2(5, 10)

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_22wem"]
content_margin_left = 250.0

[sub_resource type="LabelSettings" id="LabelSettings_irfee"]
font = ExtResource("3_qktla")
font_size = 50
font_color = Color(0.521569, 0.6, 0, 1)
shadow_size = 12
shadow_color = Color(0, 0, 0, 0.27451)
shadow_offset = Vector2(2, 5)

[sub_resource type="GDScript" id="GDScript_ihn3u"]
resource_name = "retry_button"
script/source = "extends Button

func _on_finish_difference(diff: SplitsDifference.Change) -> void:
	match diff:
		SplitsDifference.Change.GAIN: text = \"play again\"
		SplitsDifference.Change.LOSS: text = \"try again\"
		_: text = \"play again\"
"

[sub_resource type="LabelSettings" id="LabelSettings_uqsxe"]
font = ExtResource("5_llemr")
font_size = 25
font_color = Color(0.992157, 0.964706, 0.890196, 1)
shadow_size = 4
shadow_color = Color(0.168627, 0.168627, 0.168627, 0.568627)

[sub_resource type="GDScript" id="GDScript_fnuhm"]
resource_name = "helpfull"
script/source = "extends Label

var db := {
	SplitsDifference.Change.GAIN: PackedStringArray([
		\"nice time\",
		\"great job\",
		\"groundbreaking time\",
		\"couldnt do better myself\",
		\"motivational message\",
		\"see you on the next map\",
		\"that corner was perfect\",
		\"such speed\"
	]),
	SplitsDifference.Change.LOSS:
		PackedStringArray([
			\"theres always next time\",
			\"maybe take that corner tighter\", # i love it when the game backseats me
			\"if you take that turn wider youll get more speed\",
			\"that corner was rough\",
			\"too much speed, eh\",
			\"i hate it when things go wrong for a inexplicable reason\",
			\"better luck next time\",
			\"the great thing about video games is you can try again\",
			\"sad times\",
			\"wow, thats a good ghost\"
		]),
	SplitsDifference.Change.EQUAL:
		PackedStringArray([
			\"wow, you matched that time\",
			\"1/100 moment\",
			\"get the camera, the time was matched\",
			\"its not even like theres a deterministic physics engine\"
		]),
	-1:
		PackedStringArray([
			\"good first try\",
			\"a decent attempt\",
			\"wr pace next attempt\",
			\"hard map innit\",
			\"are you going to go again\"
		])

}


func _on_finish_difference(diff) -> void:
	text = db[diff][randi() % len(db[diff])]
"

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hc6gh"]
bg_color = Color(0.6, 0.6, 0.6, 0)
border_width_left = 5
border_width_top = 5
border_width_right = 5
border_width_bottom = 5
border_color = Color(0.576471, 0.631373, 0.631373, 1)
corner_radius_top_left = 100
corner_radius_top_right = 100
corner_radius_bottom_right = 100
corner_radius_bottom_left = 100
corner_detail = 12
anti_aliasing = false

[node name="finish" type="ColorRect" node_paths=PackedStringArray("diff", "time_", "flag", "focus", "retry", "quit", "next")]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_aykd4")
color = Color(0.121569, 0.121569, 0.121569, 0.709804)
script = ExtResource("1_crs2w")
diff = NodePath("center/panel/container/splits/diff")
time_ = NodePath("center/panel/container/splits/hcontainer/time")
flag = NodePath("center/panel/container/splits/hcontainer/flag")
focus = NodePath("center/panel/container/buttons/retry")
retry = NodePath("center/panel/container/buttons/retry")
quit = NodePath("center/panel/container/buttons/quit")
next = NodePath("center/panel/container/buttons/next")

[node name="center" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="panel" type="PanelContainer" parent="center"]
clip_children = 2
custom_minimum_size = Vector2(1000, 0)
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_bgqa0")

[node name="container" type="VBoxContainer" parent="center/panel"]
layout_mode = 2

[node name="splits" type="VBoxContainer" parent="center/panel/container"]
layout_mode = 2
size_flags_horizontal = 4
theme_override_constants/separation = -70

[node name="hcontainer" type="HBoxContainer" parent="center/panel/container/splits"]
custom_minimum_size = Vector2(0, 240)
layout_mode = 2
theme_override_constants/separation = 50
alignment = 1

[node name="flag" type="Label" parent="center/panel/container/splits/hcontainer"]
layout_mode = 2
size_flags_vertical = 1
text = "󰮚"
label_settings = SubResource("LabelSettings_f3a8x")
horizontal_alignment = 1
vertical_alignment = 2

[node name="time" type="Label" parent="center/panel/container/splits/hcontainer"]
layout_mode = 2
text = "1:24.187"
label_settings = SubResource("LabelSettings_m62vt")

[node name="diff" type="Label" parent="center/panel/container/splits"]
layout_mode = 2
theme_override_styles/normal = SubResource("StyleBoxEmpty_22wem")
text = "-0:00.125"
label_settings = SubResource("LabelSettings_irfee")
script = ExtResource("2_gtres")
gain_color = Color(0.521569, 0.6, 0, 1)
loss_color = Color(0.921569, 0.32549, 0.317647, 1)

[node name="spacer" type="Control" parent="center/panel/container"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 2

[node name="buttons" type="VBoxContainer" parent="center/panel/container"]
layout_mode = 2
theme_override_constants/separation = 5

[node name="retry" type="Button" parent="center/panel/container/buttons"]
layout_mode = 2
tooltip_text = "go for another go?"
theme_override_styles/focus = ExtResource("4_dck0l")
text = "play again"
script = SubResource("GDScript_ihn3u")

[node name="next" type="Button" parent="center/panel/container/buttons"]
layout_mode = 2
theme_override_styles/focus = ExtResource("4_dck0l")
text = "next map"

[node name="quit" type="Button" parent="center/panel/container/buttons"]
layout_mode = 2
theme_override_styles/focus = ExtResource("4_dck0l")
text = "exit"

[node name="helpfull" type="Label" parent="center/panel/container"]
custom_minimum_size = Vector2(0, 40)
layout_mode = 2
text = "hi"
label_settings = SubResource("LabelSettings_uqsxe")
horizontal_alignment = 1
vertical_alignment = 1
script = SubResource("GDScript_fnuhm")

[node name="border" type="Panel" parent="center/panel"]
layout_mode = 2
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_hc6gh")

[connection signal="difference" from="." to="center/panel/container/buttons/retry" method="_on_finish_difference"]
[connection signal="difference" from="." to="center/panel/container/helpfull" method="_on_finish_difference"]