tweaks to controller and savegames are stored by level
This commit is contained in:
@@ -20,7 +20,6 @@ var reserve_ammo
|
||||
|
||||
## SAVE DATA PATHS
|
||||
var persistent_save_path = "user://persistent_data.save"
|
||||
var game_save_path = "user://gamesave.save"
|
||||
|
||||
func _ready() -> void:
|
||||
if player_deaths == null:
|
||||
@@ -59,9 +58,10 @@ func load_persistent_data():
|
||||
enemies_killed = null
|
||||
|
||||
|
||||
func save_game_data():
|
||||
func save_game_data(level_name):
|
||||
var level_control = get_tree().current_scene
|
||||
var player = level_control.player
|
||||
var game_save_path = str("user://",level_name,"_gamesave.save")
|
||||
var file = FileAccess.open(game_save_path, FileAccess.WRITE)
|
||||
|
||||
#ASSIGN DATA TO VARIABLES
|
||||
@@ -115,10 +115,17 @@ func clear_persistent_data():
|
||||
print("PERSISTENT DATA CLEARED")
|
||||
file.close()
|
||||
|
||||
func load_save_game_data():
|
||||
func check_save_game_exists(level_name):
|
||||
var game_save_path = str("user://",level_name,"_gamesave.save")
|
||||
if FileAccess.file_exists(game_save_path):
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
||||
func load_save_game_data(level_name):
|
||||
var level_control = get_tree().current_scene
|
||||
var player = level_control.player
|
||||
|
||||
var game_save_path = str("user://",level_name,"_gamesave.save")
|
||||
if FileAccess.file_exists(game_save_path):
|
||||
var file = FileAccess.open(game_save_path, FileAccess.READ)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user