I'm finishing up a game that makes very careful use of fading in certain images and audio loops at specific times, and I keep running into the following problem: when a player refreshes the page, Sugarcube remembers what page they were on and immediately reloads it (good!). However, it loses track of whatever audio was playing/whatever images had been faded in, and therefore shows a page with no sound and the default CSS (bad!).
I figure there are two possible solutions to this:
1) Get Sugarcube to remember what audio is currently playing, as well as what CSS fades have been implemented with jQuery on previous pages.
2) Force a full game restart (i.e., call Engine.restart()) on a browser refresh. (This isn't a big deal as the game is only ~20 minutes long.)
I'm happy with either of these solutions, but I can't figure out how to implement either. I imagine #2 is easier. Any advice?