Skip to content

Commit 836dfb9

Browse files
committed
Add free coins
Added the option to get 1500 free coins for testing purposes.
1 parent e4d6f1d commit 836dfb9

2 files changed

Lines changed: 50 additions & 22 deletions

File tree

project/assets/scripts/main.gd

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ func _ready() -> void:
2121
$Start.show()
2222
$Start/Arrow_Left.hide()
2323
$Start/Arrow_Right.hide()
24+
$Start/Label.hide()
2425
if Global.skin == 0:
2526
get_tree().call_group("Frog", "show")
2627
get_tree().call_group("Rabbit", "hide")
@@ -38,8 +39,18 @@ func _ready() -> void:
3839
$Start/Arrow_Left.show()
3940
$Start/Arrow_Right.show()
4041
$Start/Username.text = Global.user
41-
$Start/Coins.text = str(Global.coins)
42+
$Start/Coins.text = str(Global.coins) + " Coins"
4243
$High_Score.text = str(Global.high_score)
44+
if not "rabbit" in Global.skins:
45+
if not "squirrel" in Global.skins:
46+
if Global.coins < 1500:
47+
$Start/Label.show()
48+
else:
49+
if Global.coins < 500:
50+
$Start/Label.show()
51+
elif not "squirrel" in Global.skins:
52+
if Global.coins < 1000:
53+
$Start/Label.show()
4354

4455
func _process(delta: float) -> void:
4556
if scroll:
@@ -137,7 +148,7 @@ func _start_game() -> void:
137148
await Global.edit_user(Global.user, "coins", Global.coins)
138149
await Global.edit_user(Global.user, "skins", ",".join(Global.skins))
139150
$Start/Button.disabled = false
140-
$Start/Coins.text = str(Global.coins)
151+
$Start/Coins.text = str(Global.coins) + " Coins"
141152
$Start/Button.text = "Play Game"
142153
$Loading.hide()
143154
$Loading/Circle.stop()
@@ -260,6 +271,16 @@ func _on_signin_authenticated() -> void:
260271
$Signin._on_has_account_button_pressed()
261272
$Loading.hide()
262273
$Loading/Circle.stop()
274+
if not "rabbit" in Global.skins:
275+
if not "squirrel" in Global.skins:
276+
if Global.coins < 1500:
277+
$Start/Label.show()
278+
else:
279+
if Global.coins < 500:
280+
$Start/Label.show()
281+
elif not "squirrel" in Global.skins:
282+
if Global.coins < 1000:
283+
$Start/Label.show()
263284

264285
func _show_leaderboard() -> void:
265286
$Loading.show()
@@ -313,3 +334,13 @@ func _close_leaderboard() -> void:
313334
$Leaderboard/Row9/HighScore.text = "---"
314335
$Leaderboard/Row10/Username.text = "Loading..."
315336
$Leaderboard/Row10/HighScore.text = "---"
337+
338+
func _get_free() -> void:
339+
$Loading.show()
340+
$Loading/Circle.play()
341+
Global.coins += 1500
342+
$Start/Coins.text = str(Global.coins) + " Coins"
343+
await Global.edit_user(Global.user, "coins", Global.coins)
344+
$Loading.hide()
345+
$Loading/Circle.stop()
346+
$Start/Label.hide()

project/main.tscn

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,6 @@ theme_override_font_sizes/font_size = 35
949949
text = "Loading..."
950950
horizontal_alignment = 1
951951
vertical_alignment = 1
952-
visible_characters = 16
953-
visible_ratio = 1.23077
954952

955953
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row1"]
956954
layout_mode = 2
@@ -994,8 +992,6 @@ theme_override_font_sizes/font_size = 35
994992
text = "Loading..."
995993
horizontal_alignment = 1
996994
vertical_alignment = 1
997-
visible_characters = 16
998-
visible_ratio = 1.23077
999995

1000996
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row2"]
1001997
layout_mode = 2
@@ -1039,8 +1035,6 @@ theme_override_font_sizes/font_size = 35
10391035
text = "Loading..."
10401036
horizontal_alignment = 1
10411037
vertical_alignment = 1
1042-
visible_characters = 16
1043-
visible_ratio = 1.23077
10441038

10451039
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row3"]
10461040
layout_mode = 2
@@ -1084,8 +1078,6 @@ theme_override_font_sizes/font_size = 35
10841078
text = "Loading..."
10851079
horizontal_alignment = 1
10861080
vertical_alignment = 1
1087-
visible_characters = 16
1088-
visible_ratio = 1.23077
10891081

10901082
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row4"]
10911083
layout_mode = 2
@@ -1129,8 +1121,6 @@ theme_override_font_sizes/font_size = 35
11291121
text = "Loading..."
11301122
horizontal_alignment = 1
11311123
vertical_alignment = 1
1132-
visible_characters = 16
1133-
visible_ratio = 1.23077
11341124

11351125
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row5"]
11361126
layout_mode = 2
@@ -1174,8 +1164,6 @@ theme_override_font_sizes/font_size = 35
11741164
text = "Loading..."
11751165
horizontal_alignment = 1
11761166
vertical_alignment = 1
1177-
visible_characters = 16
1178-
visible_ratio = 1.23077
11791167

11801168
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row6"]
11811169
layout_mode = 2
@@ -1219,8 +1207,6 @@ theme_override_font_sizes/font_size = 35
12191207
text = "Loading..."
12201208
horizontal_alignment = 1
12211209
vertical_alignment = 1
1222-
visible_characters = 16
1223-
visible_ratio = 1.23077
12241210

12251211
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row7"]
12261212
layout_mode = 2
@@ -1264,8 +1250,6 @@ theme_override_font_sizes/font_size = 35
12641250
text = "Loading..."
12651251
horizontal_alignment = 1
12661252
vertical_alignment = 1
1267-
visible_characters = 16
1268-
visible_ratio = 1.23077
12691253

12701254
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row8"]
12711255
layout_mode = 2
@@ -1309,8 +1293,6 @@ theme_override_font_sizes/font_size = 35
13091293
text = "Loading..."
13101294
horizontal_alignment = 1
13111295
vertical_alignment = 1
1312-
visible_characters = 16
1313-
visible_ratio = 1.23077
13141296

13151297
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row9"]
13161298
layout_mode = 2
@@ -1354,8 +1336,6 @@ theme_override_font_sizes/font_size = 35
13541336
text = "Loading..."
13551337
horizontal_alignment = 1
13561338
vertical_alignment = 1
1357-
visible_characters = 15
1358-
visible_ratio = 7.5
13591339

13601340
[node name="VSeparator2" type="VSeparator" parent="Leaderboard/Row10"]
13611341
layout_mode = 2
@@ -1501,6 +1481,22 @@ theme_override_font_sizes/font_size = 30
15011481
text_overrun_behavior = 1
15021482
metadata/_edit_use_anchors_ = true
15031483

1484+
[node name="Label" type="Label" parent="Start"]
1485+
offset_left = 11.0
1486+
offset_top = 7.0
1487+
offset_right = 201.0
1488+
offset_bottom = 33.0
1489+
theme_override_font_sizes/font_size = 18
1490+
text = "Testing for High Seas?"
1491+
1492+
[node name="LinkButton" type="LinkButton" parent="Start/Label"]
1493+
layout_mode = 0
1494+
offset_top = 22.0
1495+
offset_right = 134.0
1496+
offset_bottom = 62.0
1497+
theme_override_font_sizes/font_size = 18
1498+
text = "Get 1500 Coins!"
1499+
15041500
[node name="End" type="Node2D" parent="."]
15051501
visible = false
15061502
top_level = true
@@ -1632,5 +1628,6 @@ text = "Loading"
16321628
[connection signal="pressed" from="Start/Arrow_Right" to="." method="_on_arrow_right_pressed"]
16331629
[connection signal="pressed" from="Start/Button" to="." method="_start_game"]
16341630
[connection signal="pressed" from="Start/Leaderboard" to="." method="_show_leaderboard"]
1631+
[connection signal="pressed" from="Start/Label/LinkButton" to="." method="_get_free"]
16351632
[connection signal="pressed" from="End/Button" to="." method="_restart_game"]
16361633
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

0 commit comments

Comments
 (0)