You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
400 B
17 lines
400 B
extends Label
|
|
|
|
var lastscore = 0
|
|
|
|
func load_game():
|
|
var save_game = File.new()
|
|
if not save_game.file_exists("user://savegame.save"):
|
|
return
|
|
save_game.open("user://savegame.save", File.READ)
|
|
while save_game.get_position() < save_game.get_len():
|
|
var data = parse_json(save_game.get_line())
|
|
lastscore = data["lastscore"]
|
|
|
|
|
|
func _ready():
|
|
load_game()
|
|
text="Score\n" + str(round(lastscore))
|
|
|