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.
18 lines
395 B
18 lines
395 B
4 years ago
|
extends Label
|
||
|
|
||
|
var hiscore = 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())
|
||
|
hiscore = data["hiscore"]
|
||
|
|
||
|
|
||
|
func _ready():
|
||
|
load_game()
|
||
|
text="Hi-Score\n" + str(round(hiscore))
|