#How do I save High Score between game sessions?

4 messages · Page 1 of 1 (latest)

silk harness
#

and my game over script:```
extends Control

@onready var game_over_label: Label = $gameOverLabel
@onready var play_again_label: Label = $playAgainLabel
@onready var timer: Timer = $Timer
var _can_press_space: bool = false

func _ready():
GameManager.on_game_over.connect(on_game_over)

func _process(_delta):
if _can_press_space == true:
if Input.is_action_just_pressed("swim") == true:
GameManager.load_main_scene()

func on_game_over() -> void:
show()
timer.start()

func run_sequence() -> void:
game_over_label.hide()
play_again_label.show()
_can_press_space = true

func _on_timer_timeout() -> void:
run_sequence()```

hushed wagon
#

You copied your Main scene script a second time instead of your GameManager script. As the get_high_score function is there, it's hard to understand how you're working with your high score at the moment in order to help you 🙂

silk harness
#

oops