load and save attributes

ZahraZahra Member Posts: 1
edited November -1 in Working with GS (Mac)
hello everyone,
I'm actually creating a drag and drop game, such that user can create different scenes by choosing some actors to create those scenes.. I need to save those scenes such that when the user runs the application he can see what scenes he created last time, is that possible ?!
I've read that using load and save attribute might help but still i didn't get it :(
can anyone help ?!

Comments

  • jb15jb15 Member Posts: 602
    Does this help?

  • JeffreyShimaneJeffreyShimane Member Posts: 372
    You're going to need a lot of attributes to track which actors are in what scenes and where they are positioned in those scenes and a lot of loading/saving to the attributes to make sure the custom scene is saved and loaded even after the app is shutdown.

    For example, say your scene can have 1 background image and 1 actor in it. You would need 1 attribute that tracks which background image was selected. You would need 1 attribute that tracks which actor was selected. You would need 2 attributes to track the X/Y position of the actor (assuming the player can place the actor anywhere in the scene). Assuming the background image is full-screen, there's no need to track its X/Y position. Then you would need to create a load and a save attribute/key for each of those (and put those wherever your load/save takes place). It could be auto-load/save whenever the player goes in/out of the scene or you could have load/save buttons. In the scene, you could have an invisible actor with rules in it that spawns the correct background/actor or you could have an invisible background/actor with rules in it that changes the image in the background/actor to match what the user chose (and also changes the X/Y position of the actor to match where the player placed it).

    More actors could be added but you would have to add more attributes and load/save attributes.
Sign In or Register to comment.