2023-11-08 14:28:55 +11:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
|
2023-12-17 02:02:16 +11:00
|
|
|
func _ready() -> void:
|
|
|
|
var wins = float(Data.save_stats.twenty_game_history.count(true))
|
|
|
|
var games = float(Data.save_stats.twenty_game_history.size())
|
|
|
|
var winrate = int((wins / games) * 100.0)
|
|
|
|
$Label2.text = "Your 20-game winrate is now: " + str(winrate) + "%!"
|
|
|
|
$Label3.text = "Total games: " + str(Data.save_stats.wins + Data.save_stats.losses)
|
|
|
|
$Label4.text = "Total wins: " + str(Data.save_stats.wins)
|
|
|
|
$Label5.text = "Total losses: " + str(Data.save_stats.losses)
|
|
|
|
|
|
|
|
|
2023-11-08 14:28:55 +11:00
|
|
|
func _on_quit_button_pressed() -> void:
|
2023-11-20 21:20:29 +11:00
|
|
|
Game.scene_switch_main_menu()
|
|
|
|
queue_free()
|
2023-11-08 14:28:55 +11:00
|
|
|
|
|
|
|
|
|
|
|
func _on_restart_button_pressed() -> void:
|
|
|
|
Game.restart_game()
|
|
|
|
queue_free()
|
2023-12-17 02:02:16 +11:00
|
|
|
|
|
|
|
|
|
|
|
func _on_button_mouse_entered() -> void:
|
|
|
|
$AudioStreamPlayer.play()
|