Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (28 sloc) 1.2 KB

"Saving Games": Harlowe (v2.0)


Harlowe provides macros like (save-game:) and (load-game:) to store and retrieve game "saves" of the variables and current passage. (saved-games:) can also be used to check if a certain game save exists.

Game saves are stored as cookies in the user's browser. If cookies cannot be stored for some reason, game saves will fail. It is recommended to always check if the game save was stored before trying to retrieve it later.

Live Example

<iframe src="harlowe_savinggames_example.html" height=400 width=90%></iframe>

Download: Live Example

Twee Code

:: StoryTitle
Saving Games in Harlowe

:: Start
(link:"Save game?")[
  (if:(save-game:"Slot A"))[
	(if: (saved-games:) contains "Slot A")[
		Slot A is in the saved-games datamap!
	(link: "Load Slot A?" )[
  		(load-game: "Slot A")
  ](else: )[
    Sorry, I couldn't save your game.

Download: Twee Code