Skip to contents

Creates a backup of RAM. This is different from a full copy (e.g. my_copy = RAM):

Copy A full copy of the RAM; this will restore the full state of the RAM, deleting any inputs or debug info that may have happened since.
BackupA backup of most RAM data, but excluding inputs and debug information; these will be preserved if the backup is restored.

Usage

ram.backup(RAM)

Arguments

RAM

RAM object.

Value

RAM, minus $ROM, $inputs, $debug, $intermediate, $backup, and $paused.
This output is stored in the main RAM's $intermediate and $backup.

Details

The game uses this to periodically back up the gamestate so that it can restore it in a rollback.

Examples

if (FALSE) { # \dontrun{
RAM = ram.init(Snake)

#copy
RAM_copy = RAM
print(names(RAM_copy))

#backup
RAM_backup = ram.backup(RAM)
print(names(RAM_backup))
} # }