What would be the best way to create a save select screen with more than 1 selectable save file, so far i have managed to get one save file working but i don't know how i would manage more than one of them, saving to it and loading that particular one when needed
here's the code for my saving and loading system
const FILE_NAME = "user://game-data1.json"
var player = {
"collected_level_one":false,
}
func save():
var file = File.new()
file.open(FILE_NAME, File.WRITE)
file.store_string(to_json(player))
file.close()
func load():
var file = File.new()
if file.file_exists(FILE_NAME):
file.open(FILE_NAME, File.READ)
var data = parse_json(file.get_as_text())
file.close()
if typeof(data) == TYPE_DICTIONARY:
player = data
else:
printerr("Corrupted data!")
else:
printerr("No saved data!")