fix rounds display on finish

This commit is contained in:
interfisch 2025-03-22 22:04:17 +01:00
parent 5e2084109e
commit d1e189cf06
3 changed files with 83 additions and 8 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=3 uid="uid://ccy3rfrd1jpg1"]
[gd_scene load_steps=23 format=3 uid="uid://ccy3rfrd1jpg1"]
[ext_resource type="Texture2D" uid="uid://csknopg1cbqbq" path="res://sprites/background/green_gradient.png" id="1_wo3gb"]
[ext_resource type="Script" path="res://scripts/map_settings.gd" id="1_y50df"]
@ -14,15 +14,25 @@
[ext_resource type="Texture2D" uid="uid://bqroujxkfem6w" path="res://sprites/smooth_fields/fields_bush_008.png" id="9_dl7d5"]
[ext_resource type="Texture2D" uid="uid://boj2l5gdvhjb5" path="res://sprites/smooth_fields/fields_flower_003.png" id="10_28hf3"]
[ext_resource type="Texture2D" uid="uid://7nxi48ue47ka" path="res://sprites/smooth_fields/fields_flower_002.png" id="11_pe1eu"]
[ext_resource type="Texture2D" uid="uid://do3gd2qodpq66" path="res://sprites/road/checkpoint.png" id="15_oino7"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dltky"]
size = Vector2(32, 128)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uys5r"]
size = Vector2(208, 128)
size = Vector2(91, 44)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_82iti"]
size = Vector2(128, 160)
size = Vector2(32, 128)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_j11df"]
size = Vector2(15.5449, 228.995)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_53rfg"]
size = Vector2(272, 24)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2qp5g"]
size = Vector2(20, 146.447)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_daqun"]
size = Vector2(384, 128)
@ -42,7 +52,7 @@ texture = ExtResource("1_wo3gb")
[node name="Line2D2_right" type="Line2D" parent="."]
z_index = 1
points = PackedVector2Array(-256, 64, 640, 64, 768, 96, 832, 160, 896, 256, 896, 416, 928, 512, 1024, 576, 1152, 608, 1280, 608, 1536, 608, 2048, 256, 2112, 160, 2144, 0, 2144, -128, 2176, -224, 2304, -256, 2432, -224, 2528, -128, 2560, 0, 2624, 64, 2816, 96, 2912, 96, 3328, 96, 3328, -256, 3168, -256, 3168, -352, 3456, -352, 3456, -480, 3584, -480, 3584, -256, 3392, -256, 3392, 96, 3360, 192, 3232, 224, 2944, 256, 2848, 288, 2784, 384, 2752, 512, 2752, 608, 2816, 704, 3040, 768, 3264, 736, 3488, 608, 3648, 416, 3712, 224, 3776, 64, 3872, 0, 4096, 0, 4352, 0, 4512, -128, 4768, 96, 5024, -96, 5248, 0, 5317, -36, 5632, 64, 5856, 160, 6080, 192, 6304, 192, 6560, 288, 6886, 394, 7148, 426, 7316, 414, 7441, 316, 7574, 119, 7750, 30, 8032, 64, 8256, 0, 8352, -160, 8352, -352, 8256, -512, 8064, -608, 7808, -640, 7520, -640, 7200, -672, 7104, -736, 7104, -832, 7136, -896, 7264, -928, 7712, -896, 8064, -768, 8352, -544, 8448, -320, 8576, -64, 8800, 32, 8995, 103, 8800, 160, 8704, 512, 8736, 704, 8864, 736, 9216, 704, 9472, 608, 9600, 448, 9664, 288, 9888, 256, 10200, 207, 10558, 10, 10619, -111, 10536, -422, 10536, -654, 10528, -896, 10528, -1344)
points = PackedVector2Array(-256, 64, 640, 64, 768, 96, 832, 160, 896, 256, 896, 416, 928, 512, 1024, 576, 1152, 608, 1280, 608, 1536, 608, 2048, 256, 2112, 160, 2144, 0, 2144, -128, 2176, -224, 2304, -256, 2432, -224, 2528, -128, 2560, 0, 2624, 64, 2816, 96, 2912, 96, 3328, 96, 3328, -256, 3168, -256, 3168, -352, 3456, -352, 3456, -480, 3584, -480, 3584, -256, 3392, -256, 3392, 96, 3360, 192, 3232, 224, 2944, 256, 2848, 288, 2784, 384, 2752, 512, 2752, 608, 2816, 704, 3040, 768, 3264, 736, 3488, 608, 3648, 416, 3712, 224, 3776, 64, 3872, 0, 4096, 0, 4352, 0, 4512, -128, 4768, 96, 5024, -96, 5248, 0, 5317, -36, 5632, 64, 5856, 160, 6080, 192, 6304, 192, 6560, 288, 6886, 394, 7148, 426, 7316, 414, 7441, 316, 7574, 119, 7750, 30, 8032, 64, 8256, 0, 8352, -160, 8352, -352, 8256, -512, 8064, -608, 7808, -640, 7520, -640, 7200, -672, 7104, -736, 7104, -832, 7136, -896, 7264, -928, 7712, -896, 8064, -768, 8352, -544, 8448, -320, 8576, -64, 8800, 32, 8995, 103, 8800, 160, 8704, 512, 8736, 704, 8864, 736, 9216, 704, 9472, 608, 9600, 448, 9664, 288, 9888, 256, 10200, 207, 10558, 10, 10619, -111, 10536, -422, 10536, -654, 10528, -896, 10528, -2632)
width = 6.0
texture = ExtResource("2_2ey0t")
texture_mode = 1
@ -58,7 +68,7 @@ texture_mode = 1
[node name="Line2D2_left" type="Line2D" parent="."]
z_index = 1
points = PackedVector2Array(-256, -64, 640, -64, 800, -32, 928, 64, 1024, 224, 1024, 384, 1088, 480, 1280, 512, 1504, 512, 1952, 224, 2016, 96, 2048, -64, 2080, -224, 2144, -320, 2272, -352, 2432, -320, 2592, -224, 2624, -96, 2720, -32, 2880, -32, 3232, -32, 3232, -160, 3104, -160, 3104, -416, 3392, -416, 3392, -544, 3648, -544, 3680, -448, 3680, -192, 3648, -128, 3520, -128, 3488, -96, 3488, 96, 3456, 256, 3360, 320, 3168, 352, 2944, 352, 2880, 416, 2880, 512, 3040, 576, 3264, 544, 3520, 416, 3616, 224, 3648, 32, 3776, -64, 4032, -128, 4096, -128, 4320, -128, 4512, -224, 4768, -64, 5024, -192, 5216, -128, 5419, -136, 5682, -76, 6013, 11, 6496, 68, 6994, 168, 7379, -25, 7543, -127, 7782, -186, 8000, -160, 8160, -160, 8224, -256, 8160, -384, 7968, -480, 7616, -544, 7296, -544, 7040, -608, 6912, -736, 6944, -928, 7104, -1088, 7296, -1120, 7680, -1120, 7968, -1088, 8064, -992, 8160, -800, 8352, -640, 8480, -512, 8544, -320, 8640, -160, 8736, -96, 8928, -32, 9120, 0, 9248, 160, 9120, 288, 8896, 352, 8832, 512, 8864, 640, 9056, 608, 9472, 416, 9592, 170, 9984, 96, 10176, 0, 10400, -96, 10368, -416, 10144, -704, 10144, -1344)
points = PackedVector2Array(-256, -64, 640, -64, 800, -32, 928, 64, 1024, 224, 1024, 384, 1088, 480, 1280, 512, 1504, 512, 1952, 224, 2016, 96, 2048, -64, 2080, -224, 2144, -320, 2272, -352, 2432, -320, 2592, -224, 2624, -96, 2720, -32, 2880, -32, 3232, -32, 3232, -160, 3104, -160, 3104, -416, 3392, -416, 3392, -544, 3648, -544, 3680, -448, 3680, -192, 3648, -128, 3520, -128, 3488, -96, 3488, 96, 3456, 256, 3360, 320, 3168, 352, 2944, 352, 2880, 416, 2880, 512, 3040, 576, 3264, 544, 3520, 416, 3616, 224, 3648, 32, 3776, -64, 4032, -128, 4096, -128, 4320, -128, 4512, -224, 4768, -64, 5024, -192, 5216, -128, 5419, -136, 5682, -76, 6013, 11, 6496, 68, 6994, 168, 7379, -25, 7543, -127, 7782, -186, 8000, -160, 8160, -160, 8224, -256, 8160, -384, 7968, -480, 7616, -544, 7296, -544, 7040, -608, 6912, -736, 6944, -928, 7104, -1088, 7296, -1120, 7680, -1120, 7968, -1088, 8064, -992, 8160, -800, 8352, -640, 8480, -512, 8544, -320, 8640, -160, 8736, -96, 8928, -32, 9120, 0, 9248, 160, 9120, 288, 8896, 352, 8832, 512, 8864, 640, 9056, 608, 9472, 416, 9592, 170, 9984, 96, 10176, 0, 10400, -96, 10368, -416, 10144, -704, 10144, -2632)
width = 6.0
texture = ExtResource("2_2ey0t")
texture_mode = 1
@ -92,7 +102,7 @@ collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp1"]
position = Vector2(5312, -64)
position = Vector2(3441.5, -58)
shape = SubResource("RectangleShape2D_uys5r")
debug_color = Color(0.371138, 0.615246, 1.54018e-06, 0.42)
@ -101,10 +111,37 @@ collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp2"]
position = Vector2(8832, -16)
position = Vector2(4080, -64)
shape = SubResource("RectangleShape2D_82iti")
debug_color = Color(0, 0.568664, 0.85224, 0.42)
[node name="area_cp3" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp3"]
position = Vector2(6807.55, 249.841)
rotation = 0.23911
scale = Vector2(1, 1)
shape = SubResource("RectangleShape2D_j11df")
[node name="area_cp4" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp4"]
position = Vector2(9088, 116)
shape = SubResource("RectangleShape2D_53rfg")
[node name="area_cp5" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp5"]
position = Vector2(9990.77, 167.322)
rotation = -0.158825
shape = SubResource("RectangleShape2D_2qp5g")
[node name="area_finish" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
@ -156,3 +193,39 @@ points = PackedVector2Array(128, -48, 128, 48)
width = 16.0
texture = ExtResource("7_rldo0")
texture_mode = 1
[node name="line2d_cp0" type="Line2D" parent="Node2D_Roadmarkings"]
points = PackedVector2Array(2261, -340, 2261, -248)
width = 16.0
texture = ExtResource("15_oino7")
texture_mode = 1
[node name="line2d_cp1" type="Line2D" parent="Node2D_Roadmarkings"]
points = PackedVector2Array(3400, -80, 3480, -80)
width = 16.0
texture = ExtResource("15_oino7")
texture_mode = 1
[node name="line2d_cp2" type="Line2D" parent="Node2D_Roadmarkings"]
points = PackedVector2Array(4064, -8, 4064, -120)
width = 16.0
texture = ExtResource("15_oino7")
texture_mode = 1
[node name="line2d_cp3" type="Line2D" parent="Node2D_Roadmarkings"]
points = PackedVector2Array(6776, 336, 6824, 144)
width = 16.0
texture = ExtResource("15_oino7")
texture_mode = 1
[node name="line2d_cp4" type="Line2D" parent="Node2D_Roadmarkings"]
points = PackedVector2Array(9184, 104, 9008, 104)
width = 16.0
texture = ExtResource("15_oino7")
texture_mode = 1
[node name="line2d_cp5" type="Line2D" parent="Node2D_Roadmarkings"]
points = PackedVector2Array(9968, 120, 9992, 224)
width = 16.0
texture = ExtResource("15_oino7")
texture_mode = 1

View file

@ -323,7 +323,7 @@ func calculate_steering(delta:float):
func getRound():
var i=getNextCPindex()/checkpoints.size()
if getNextCPindex()==-1: #all checkpoints collected
i=checkpoints.size()-1
return -1
return i

View file

@ -14,5 +14,7 @@ func _process(delta: float) -> void:
func showRounds(round):
var rounds=Gamestate.getRounds()
if (round==-1): #finished
round=rounds
text=str(round)+"/"+str(rounds)
animation_player.play("show_rounds")