Change your savepath to user://save.data
instead of using res://
.
This is explained in the Filesystem docs. You can find further information in the Saving games Tutorial.
Tip:
Even if it is not always recommended you can use print-debugging to check your projects when getting errors or when it shows strange behavior. Insert a print("App quitted because the save.data file could not be found.")
right before your return statement and you will see that something is happening there.
//EDIT:
I looked into your project files and you clearly messed something up with your filepaths. I'm not sure why it is not recognized when starting the game in the editor but if you export you can see that files couldn't be found. This is because you used CamelCase once but your files and folders were renamed or something like that. You only have to recheck all your filepaths in your code.
Following is a list of lines that I had to adapt till the exported game started correctly. The main problem was that you used "Scene" instead of "scene" in arguments for your preload()
and change_scene()
statements:
Autoload
game - scenes/game.gd
player.gd
var punch = preload ("res://scenes/gameobjs/socoBox.tscn")
get_tree().change_scene("res://scenes/gameoverscreen.tscn")
get_tree().change_scene("res://scenes/worldselect.tscn")
worldselect.gd
get_tree().change_scene("res://scenes/game.tscn")
gameover.tscn
get_tree().change_scene("res://scenes/menu.tscn")
configuracoes.tscn
get_tree().change_scene("res://scenes/menu.tscn")
SplashScreen.tscn
get_tree().change_scene("res://scenes/menu.tscn")
menu.tscn
get_tree().change_scene("res://scenes/worldselect.tscn")
get_tree().change_scene("res://scenes/game.tscn")