This commit is contained in:
2025-09-08 15:28:23 +02:00
parent 9ee0d4708b
commit 2781204d6d
2 changed files with 5 additions and 5 deletions

View File

@@ -33,11 +33,11 @@ func start_two_player()->void:
func start_menu(user_name : String)->void:
printt(user_name, actual_score)
if is_multiplayer:
var temp = score.score_multiplayer.get_or_add(user_name, 0.0)
var temp = score.score_multiplayer.get(user_name, -1.0)
if temp < actual_score:
score.score_multiplayer[user_name] = actual_score
else:
var temp = score.score_singleplayer.get_or_add(user_name, 0.0)
var temp = score.score_singleplayer.get(user_name, -1.0)
if temp < actual_score:
score.score_singleplayer[user_name] = actual_score
user_name = ""

View File

@@ -43,7 +43,7 @@ func _ready() -> void:
# Trier par ordre alphabétique
tableau_paires.sort_custom(func(a, b): return a[\"value\"] > b[\"value\"])
text += \"1 Player\"
text += \" 1 Player\"
for i in range(clamp(5, 0, tableau_paires.size())):
text += \"\\n\" + tableau_paires[i][\"key\"] + \" : \" + str(tableau_paires[i][\"value\"])
"
@@ -57,8 +57,8 @@ func _ready() -> void:
tableau_paires.append({\"key\": key, \"value\": GameController.score.score_multiplayer[key]})
# Trier par ordre alphabétique
tableau_paires.sort_custom(func(a, b): return a[\"value\"] < b[\"value\"])
text += \"2 Players\"
tableau_paires.sort_custom(func(a, b): return a[\"value\"] > b[\"value\"])
text += \" 2 Players\"
for i in range(clamp(5, 0, tableau_paires.size())):
text += \"\\n\" + tableau_paires[i][\"key\"] + \" : \" + str(tableau_paires[i][\"value\"])
"