locked
Saving a game across sessions?

    Question

  • It would be cool if there was a way to save/load a game across gameplay sessions - or to be able to send score data to a server...
    Saturday, May 3, 2008 7:27 AM

Answers

  • Unfortunately we don't have any clean, built in support for this in our initial release.  You can however add a custom code behavior which can do anything you can do in JavaScript (just be aware of browser security settings).  You might be able to send this info to your own server that way.

     

    If you have any particular features you'd like to see in future releases regarding persistence, feel free to let us know as that can help us in our planning. 

     

    Wednesday, May 7, 2008 5:46 PM

All replies

  • Unfortunately we don't have any clean, built in support for this in our initial release.  You can however add a custom code behavior which can do anything you can do in JavaScript (just be aware of browser security settings).  You might be able to send this info to your own server that way.

     

    If you have any particular features you'd like to see in future releases regarding persistence, feel free to let us know as that can help us in our planning. 

     

    Wednesday, May 7, 2008 5:46 PM
  • Can the game set cookies or talk to the page javascript?
    Can you post a simple example of what this might look like? I dont understand about the custom code behavior, could could that communicate with the outside world?
    Friday, May 9, 2008 7:25 AM
  • You can do anything the browser security settings will let you do with javascript by adding a new "code" behavior.  As an example, check out the custom behavior of the "Lost" scene in this game:
    http://www.popfly.com/users/andersbe/Jump
    (you can rip it by clicking "Tweak" or the little pencil button in the upper right by your avatar picture)

    In this case I just make losing a little more unpleasant by adding the following code:

    Code Snippet

    document.location="http://internetisseriousbusiness.com"



    Whenever the event you specify is triggered, we call your code. 
    Wednesday, May 14, 2008 6:03 PM
  • This is insanely cool news! I cannot believe you are not talking more about this. I could see using the browser's local storage to write and read to a localstore for game saves.

    How can you get data from javascript back into the game? Like say I want to set a variable on the player based on a javascript variable I got from the page ...

    Edit:

    I'm guessing I can use something like Game.setvar or something?


    Wednesday, May 14, 2008 8:26 PM
  • There's some sparse documentation here:

    http://www.popflywiki.com/GameCreatorAPI.ashx

    To see more examples, create any behavior, set it up how you want and then click the code button on the far right and you can see the implementation and edit it as you see fit Smile
    Wednesday, May 14, 2008 8:46 PM