zrho / afp

Angewandte Funktionale Programmierung
15 stars 2 forks source link

Add a "save game" feature? #148

Closed jvoigtlaender closed 10 years ago

jvoigtlaender commented 10 years ago

All that should be needed is reactivating the route for the getPlayR handler, then adding a "Save Game" button to play.hamlet which, when clicked, pops up a message that the player should save the link '@{PlayR gameE}' as a bookmark.

jvoigtlaender commented 10 years ago

... or maybe not a pop-up message, instead a window like currently done for "About".

mehner commented 10 years ago

Isn't that a bit unfair? What would I use rhat option for other than cheating?

jvoigtlaender commented 10 years ago

For example for: "Oh, my boyfriend came home and wants my attention. So I'll store this exciting game for later, and shut down the computer now." :-)

Also, since the game doesn't use cookies, cheating is already possible (though less convenient) by using the browser's back button. (And even with cookies, a desperate player could cheat by manually copying and later reinstating cookie files.)

jvoigtlaender commented 10 years ago

Also, another way of cheating is: If you don't like that the computer has just hit you, simply reload the current page in the browser and hope that the computer makes a different choice for its last shots. :-)

mehner commented 10 years ago

I didn't think of the boyfriend scenario, because my browser resumes the last session automatically. But yes, this would be a legit use. It should be "save and leave" though, because if you save and then continue to play, you shouldn't use the link anymore. Also right now it says "you can always come back to the current game" and that clearly is an invitation to cheat. The fact that all this was possible already shouldn't influence the discussion. There's no "bribe the official"-checkbox on your tax declaration form either.

jvoigtlaender commented 10 years ago

Yeah, makes sense. So, "save and leave" then, which would mean that instead of opening a new window, the "Save" button would behave more like the "Go home" button? It would ask whether you really want to quit, then replace the current page with the page containing the link-to-save?

jvoigtlaender commented 10 years ago

BTW, does your "browser resumes the last session automatically" functionality actually work with POST-pages?

mehner commented 10 years ago

What about one button that says "save/ leave" and if you click it, you come back to the home page but with an additional text "you can resume the game by clicking the following link or save it for later by bookmarking it. if you use the link multiple times, you will be haunted by undead sailors." Thus after clicking "leave" by mistake you can still resume with one click. If you really want to leave, you save one click.

jvoigtlaender commented 10 years ago

Like that. :-)

But the button caption should also convey that using that button also gives a way to simply start a completely new game (which neither "save" nor "leave" convey, but "restart" would).

jvoigtlaender commented 10 years ago

Actually, the "being haunted" threat could also be made more generally on the "About" page. In the spirit of: "The computer doesn't cheat. You shouldn't either. No using of the browser's back or reload buttons." (Or is the latter just another invitation to do just that?)

Well, anyway, let's let the team decide how they want to go about these things.