With this function you can do a basic save of the game to a given file.
NOTE: This function is very limited and it is designed for the beginner to get a save system up and running quickly, but more advanced users may prefer to code their own system using the File functions, due to the fact that the game will not save any of the dynamic resources like data structures, surfaces, added backgrounds and sprites etc.
game_save(filename);
Argument | Description |
---|---|
filename | The name of the file to save the game to. |
N/A
if keyboard_check_pressed(ord("S"))
{
global.Saved = true;
game_save("Save.dat");
}
The above code will set a global variable to true and then saves the game to the file "Save.dat" when the key "S" is pressed.