fix scoreboard and ready for release

This commit is contained in:
2025-09-10 23:36:54 +02:00
parent eb0ba602b3
commit d4ae904c32
8 changed files with 112 additions and 56 deletions

View File

@@ -2,11 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
<<<<<<< HEAD uid="uid://h4tabd6254am"
uid="uid://ogs1yl8487x0"
=======
uid="uid://ci8v25oyjsta7"
>>>>>>> f50b0c1686c78e46b2924e970f95ca8aa439b973
path="res://.godot/imported/banner.png-becbe5b95b7f582b376b39bf2d9a8088.ctex" path="res://.godot/imported/banner.png-becbe5b95b7f582b376b39bf2d9a8088.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View File

@@ -2,11 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
<<<<<<< HEAD uid="uid://dqmdgjgqyswc2"
uid="uid://d2t2mkm5q0868"
=======
uid="uid://dhte4m2jqqnk3"
>>>>>>> f50b0c1686c78e46b2924e970f95ca8aa439b973
path="res://.godot/imported/hero.png-fdcb9bce42f62e97d19e35f646c3e9ae.ctex" path="res://.godot/imported/hero.png-fdcb9bce42f62e97d19e35f646c3e9ae.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View File

@@ -2,11 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
<<<<<<< HEAD uid="uid://lukh8731866p"
uid="uid://dpnb3i8b6w3wb"
=======
uid="uid://c16lf6uuia72r"
>>>>>>> f50b0c1686c78e46b2924e970f95ca8aa439b973
path="res://.godot/imported/icon.png-50ce51b05e583df21dba5e6ade4274ef.ctex" path="res://.godot/imported/icon.png-50ce51b05e583df21dba5e6ade4274ef.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View File

@@ -2,11 +2,7 @@
importer="oggvorbisstr" importer="oggvorbisstr"
type="AudioStreamOggVorbis" type="AudioStreamOggVorbis"
<<<<<<< HEAD uid="uid://d0wklfsmkjpf5"
uid="uid://ctwv2itux4wq8"
=======
uid="uid://bfyklo8ca5kji"
>>>>>>> f50b0c1686c78e46b2924e970f95ca8aa439b973
path="res://.godot/imported/theme.ogg-2a8b680f31de6ed20a965148078a2666.oggvorbisstr" path="res://.godot/imported/theme.ogg-2a8b680f31de6ed20a965148078a2666.oggvorbisstr"
[deps] [deps]

View File

@@ -9,7 +9,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../../export/Azzteroid.x86_64" export_path="../../export/files/Azzteroid.x86_64"
patches=PackedStringArray() patches=PackedStringArray()
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
@@ -51,7 +51,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../../export/html/index.html" export_path="../../html/index.html"
patches=PackedStringArray() patches=PackedStringArray()
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
@@ -95,7 +95,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../../export/html/Azzteroid.exe" export_path="../../../Downloads/Azzteroid.exe"
patches=PackedStringArray() patches=PackedStringArray()
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""

View File

@@ -93,10 +93,10 @@ func start_score_saver(score: int)->void:
func get_scoreboard_singleplayer(n_lignes: int = 0) -> String: func get_scoreboard_singleplayer(n_lignes: int = 0) -> String:
return " 1 Player" + _get_scoreboard(score.score_singleplayer, n_lignes) return _get_scoreboard(score.score_singleplayer, n_lignes)
func get_scoreboard_multiplayer(n_lignes: int = 0) -> String: func get_scoreboard_multiplayer(n_lignes: int = 0) -> String:
return " 2 Player" + _get_scoreboard(score.score_multiplayer, n_lignes) return _get_scoreboard(score.score_multiplayer, n_lignes)
func _get_scoreboard(dict: Dictionary, n_lignes: int) -> String: func _get_scoreboard(dict: Dictionary, n_lignes: int) -> String:
var text = "" var text = ""
@@ -107,10 +107,14 @@ func _get_scoreboard(dict: Dictionary, n_lignes: int) -> String:
if n_lignes == 0: if n_lignes == 0:
n_lignes = clamp( tableau_paires.size(), 5, 1000) n_lignes = clamp( tableau_paires.size(), 5, 1000)
for i in range(clamp(n_lignes, 0, tableau_paires.size())): for i in range(clamp(n_lignes, 0, tableau_paires.size())):
text += "\n" + str(i+1) + ". " + tableau_paires[i]["key"] + " : " + display_score(tableau_paires[i]["value"]) text += str(i+1) + ". " + tableau_paires[i]["key"] + " : " + display_score(tableau_paires[i]["value"])
if i < n_lignes-1:
text+="\n"
if tableau_paires.size() < n_lignes: if tableau_paires.size() < n_lignes:
for i in range(n_lignes - tableau_paires.size()): for i in range(n_lignes - tableau_paires.size()):
text += "\n" + str(tableau_paires.size()+ i+1) + ". " + "---- : ----" text += str(tableau_paires.size()+ i+1) + ". " + "---- : ----"
if i < n_lignes - tableau_paires.size() -1 :
text += "\n"
return text return text
func display_score(score: int) -> String: func display_score(score: int) -> String:

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://jx8hrj6k1ju8"] [gd_scene load_steps=12 format=3 uid="uid://jx8hrj6k1ju8"]
[ext_resource type="PackedScene" uid="uid://d1ugwu6dqomtg" path="res://scene/wall.tscn" id="1_7iavl"] [ext_resource type="PackedScene" uid="uid://d1ugwu6dqomtg" path="res://scene/wall.tscn" id="1_7iavl"]
[ext_resource type="Theme" uid="uid://b46gto6k33wqr" path="res://theme.tres" id="3_7iavl"] [ext_resource type="Theme" uid="uid://b46gto6k33wqr" path="res://theme.tres" id="3_7iavl"]
@@ -48,7 +48,24 @@ func _ready() -> void:
text = GameController.get_scoreboard_multiplayer(5) text = GameController.get_scoreboard_multiplayer(5)
" "
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_pyuau"] [sub_resource type="GDScript" id="GDScript_mjrrj"]
script/source = "extends ScrollContainer
var speed_scrool = 0.2
@export var delay := 0.0
func _process(delta: float) -> void:
if visible:
delay += delta
if delay >= speed_scrool:
if Input.is_action_pressed(\"down\"):
scroll_vertical += 20
delay = 0
elif Input.is_action_pressed(\"up\"):
scroll_vertical -= 20
delay = 0
"
[sub_resource type="GDScript" id="GDScript_8llpu"] [sub_resource type="GDScript" id="GDScript_8llpu"]
script/source = "extends Label script/source = "extends Label
@@ -58,14 +75,6 @@ func _ready() -> void:
text = GameController.get_scoreboard_singleplayer() text = GameController.get_scoreboard_singleplayer()
" "
[sub_resource type="GDScript" id="GDScript_dyrmm"]
script/source = "extends Label
func _ready() -> void:
text = GameController.get_scoreboard_multiplayer()
"
[node name="load_screen" type="Node2D"] [node name="load_screen" type="Node2D"]
[node name="wall" parent="." node_paths=PackedStringArray("spawner") instance=ExtResource("1_7iavl")] [node name="wall" parent="." node_paths=PackedStringArray("spawner") instance=ExtResource("1_7iavl")]
@@ -164,57 +173,116 @@ layout_mode = 2
theme = ExtResource("3_7iavl") theme = ExtResource("3_7iavl")
theme_override_constants/separation = 64 theme_override_constants/separation = 64
[node name="Label" type="Label" parent="CanvasLayer/Control/VBoxContainer/HBoxContainer/scores"] [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control/VBoxContainer/HBoxContainer/scores"]
layout_mode = 2
theme_override_constants/separation = 15
[node name="1player" type="Label" parent="CanvasLayer/Control/VBoxContainer/HBoxContainer/scores/VBoxContainer"]
layout_mode = 2
text = "1 Player"
horizontal_alignment = 1
[node name="1pscore" type="Label" parent="CanvasLayer/Control/VBoxContainer/HBoxContainer/scores/VBoxContainer"]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2 layout_mode = 2
theme = ExtResource("3_7iavl") theme = ExtResource("3_7iavl")
theme_override_font_sizes/font_size = 16 theme_override_font_sizes/font_size = 16
horizontal_alignment = 1
autowrap_mode = 1
script = SubResource("GDScript_dogtj") script = SubResource("GDScript_dogtj")
[node name="Label2" type="Label" parent="CanvasLayer/Control/VBoxContainer/HBoxContainer/scores"] [node name="VBoxContainer2" type="VBoxContainer" parent="CanvasLayer/Control/VBoxContainer/HBoxContainer/scores"]
layout_mode = 2
theme_override_constants/separation = 15
[node name="2player" type="Label" parent="CanvasLayer/Control/VBoxContainer/HBoxContainer/scores/VBoxContainer2"]
layout_mode = 2
text = "2 Player"
horizontal_alignment = 1
[node name="2pscore" type="Label" parent="CanvasLayer/Control/VBoxContainer/HBoxContainer/scores/VBoxContainer2"]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2 layout_mode = 2
theme = ExtResource("3_7iavl") theme = ExtResource("3_7iavl")
theme_override_font_sizes/font_size = 16 theme_override_font_sizes/font_size = 16
horizontal_alignment = 1
autowrap_mode = 1
script = SubResource("GDScript_u3kfb") script = SubResource("GDScript_u3kfb")
[node name="ScrollContainer" type="ScrollContainer" parent="CanvasLayer/Control"] [node name="Control" type="Control" parent="CanvasLayer/Control"]
visible = false visible = false
custom_minimum_size = Vector2(0, 320) layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ScrollContainer" type="ScrollContainer" parent="CanvasLayer/Control/Control"]
custom_minimum_size = Vector2(500, 500)
layout_mode = 1 layout_mode = 1
anchors_preset = 8 anchors_preset = 8
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 0.5 anchor_bottom = 0.5
offset_left = -7.0 offset_left = -318.0
offset_right = 7.0 offset_top = -250.0
offset_right = 318.0
offset_bottom = 250.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
focus_next = NodePath(".")
focus_previous = NodePath(".")
theme = ExtResource("3_7iavl") theme = ExtResource("3_7iavl")
draw_focus_border = true
horizontal_scroll_mode = 0 horizontal_scroll_mode = 0
script = SubResource("GDScript_mjrrj")
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/Control/ScrollContainer"] [node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/Control/Control/ScrollContainer"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6 size_flags_horizontal = 6
size_flags_vertical = 4 size_flags_vertical = 4
theme = ExtResource("3_7iavl") theme = ExtResource("3_7iavl")
theme_override_constants/separation = 32 theme_override_constants/separation = 16
[node name="Label" type="Label" parent="CanvasLayer/Control/ScrollContainer/HBoxContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control/Control/ScrollContainer/HBoxContainer"]
layout_mode = 2
[node name="1player" type="Label" parent="CanvasLayer/Control/Control/ScrollContainer/HBoxContainer/VBoxContainer"]
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
theme = ExtResource("3_7iavl")
text = "1 Player"
horizontal_alignment = 1
[node name="Label" type="Label" parent="CanvasLayer/Control/Control/ScrollContainer/HBoxContainer/VBoxContainer"]
custom_minimum_size = Vector2(280, 0)
layout_mode = 2 layout_mode = 2
size_flags_vertical = 0 size_flags_vertical = 0
theme = ExtResource("3_7iavl") theme = ExtResource("3_7iavl")
theme_override_font_sizes/font_size = 16 theme_override_font_sizes/font_size = 16
theme_override_styles/normal = SubResource("StyleBoxEmpty_pyuau") horizontal_alignment = 1
autowrap_mode = 1
script = SubResource("GDScript_8llpu") script = SubResource("GDScript_8llpu")
[node name="Label2" type="Label" parent="CanvasLayer/Control/ScrollContainer/HBoxContainer"] [node name="VBoxContainer2" type="VBoxContainer" parent="CanvasLayer/Control/Control/ScrollContainer/HBoxContainer"]
layout_mode = 2
[node name="2player" type="Label" parent="CanvasLayer/Control/Control/ScrollContainer/HBoxContainer/VBoxContainer2"]
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
theme = ExtResource("3_7iavl")
text = "2 Player"
horizontal_alignment = 1
[node name="2pscore" type="Label" parent="CanvasLayer/Control/Control/ScrollContainer/HBoxContainer/VBoxContainer2"]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2 layout_mode = 2
size_flags_vertical = 0
theme = ExtResource("3_7iavl") theme = ExtResource("3_7iavl")
theme_override_font_sizes/font_size = 16 theme_override_font_sizes/font_size = 16
theme_override_styles/normal = SubResource("StyleBoxEmpty_pyuau") horizontal_alignment = 1
script = SubResource("GDScript_dyrmm") autowrap_mode = 1
script = SubResource("GDScript_u3kfb")
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/HBoxContainer/buttons/1" to="CanvasLayer/Control/VBoxContainer/HBoxContainer/buttons/1" method="_on_pressed"] [connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/HBoxContainer/buttons/1" to="CanvasLayer/Control/VBoxContainer/HBoxContainer/buttons/1" method="_on_pressed"]
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/HBoxContainer/buttons/2" to="CanvasLayer/Control/VBoxContainer/HBoxContainer/buttons/2" method="_on_pressed"] [connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/HBoxContainer/buttons/2" to="CanvasLayer/Control/VBoxContainer/HBoxContainer/buttons/2" method="_on_pressed"]

View File

@@ -8,12 +8,12 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void: func _process(delta: float) -> void:
if Input.is_action_just_pressed("back") and $Control/ScrollContainer.visible: if (Input.is_action_just_pressed("back") or Input.is_action_just_pressed("ui_accept")) and $Control/Control.visible:
$Control/VBoxContainer.visible = true $Control/VBoxContainer.visible = true
$Control/ScrollContainer.visible = false $Control/Control.visible = false
$"Control/VBoxContainer/HBoxContainer/buttons/1".grab_focus() $"Control/VBoxContainer/HBoxContainer/buttons/1".grab_focus()
func _on_scores_pressed() -> void: func _on_scores_pressed() -> void:
$Control/VBoxContainer.grab_focus() $Control/VBoxContainer.grab_focus()
$Control/VBoxContainer.visible = false $Control/VBoxContainer.visible = false
$Control/ScrollContainer.visible = true $Control/Control.visible = true