Save game after closing app completely [click & point game]
Hello guys, I'm having problem with saving game. New game, load game(continue) works good. but if I close app completely (double press home button) and tried to continue game but load game button vanished and game starts again as a new game.
I don't have "save attribute" inside each actor, I mean I didn't put additional "save attribute" bellow the each (boolean, real, integer) attributes.
I have 4 actors which manages starting, saving, loading process, they are: New Game button, Load Game button, Save Game and Save Scene.
New Game button.
Actor receives event touch pressed!
change attribute: // only change attributes inside New Game button
game.inventory to 0
game.take_silverkey to false
game.open_door to false
etc......
// Game starts as a new.
Load Game button.
// will be visible and in action after the game started. I called it like: game_started (boolean attribute)
Attribute game.game_started is true, Actor receives touch pressed
Timer: After 0 seconds // run to completion is not clicked.
Load Attribute: //
key: 2 attribute game.inventory
key: 3 attribute game.take_silverkey
key: 4 attribute game.open_door
etc.....
// game will starts from that scene and collected items and everything loads (it's fine)
Save Game.
// I have this actor in each scene. and has only following attributes
Timer: Every 10 seconds // run to completion is clicked.
Save Attribute:
attribute game.inventory key: (expression has removed)
attribute game.take_silverkey key: (expression has removed)
etc....
Save Scene.
//I also have this actor in each scene and opened from that scene
Change Attribute: game.scene numbers to 1
game.scene numbers to 2
etc........// this is a integer attribute. and numbers
I don't have "save attribute" inside each actor, I mean I didn't put additional "save attribute" bellow the each (boolean, real, integer) attributes.
I have 4 actors which manages starting, saving, loading process, they are: New Game button, Load Game button, Save Game and Save Scene.
New Game button.
Actor receives event touch pressed!
change attribute: // only change attributes inside New Game button
game.inventory to 0
game.take_silverkey to false
game.open_door to false
etc......
// Game starts as a new.
Load Game button.
// will be visible and in action after the game started. I called it like: game_started (boolean attribute)
Attribute game.game_started is true, Actor receives touch pressed
Timer: After 0 seconds // run to completion is not clicked.
Load Attribute: //
key: 2 attribute game.inventory
key: 3 attribute game.take_silverkey
key: 4 attribute game.open_door
etc.....
// game will starts from that scene and collected items and everything loads (it's fine)
Save Game.
// I have this actor in each scene. and has only following attributes
Timer: Every 10 seconds // run to completion is clicked.
Save Attribute:
attribute game.inventory key: (expression has removed)
attribute game.take_silverkey key: (expression has removed)
etc....
Save Scene.
//I also have this actor in each scene and opened from that scene
Change Attribute: game.scene numbers to 1
game.scene numbers to 2
etc........// this is a integer attribute. and numbers
Comments
why are the keys inside the save attributes empty?
save and load attributes should also work...
The Save Attribute behavior existed before tables were added to GameSalad but it still has some use for saving individual attributes.