Hi,
I’m just wondering whats the best way to save which scene I’m currently in, and then saving that value so when i go back into the game i continue from where i left off.
im assuming ice can do this ? as i would also need to save items I’m picking up along the way.
thanks [import]uid: 17701 topic_id: 26425 reply_id: 326425[/import]
In your database table that holds the objects you should have a column that specifies the location of each object. Start your room locations at 10 and that leaves 1-9 for other things.
If you pick something up change the location for that object in the database to 1. If you drop something, change the location for that object from 1 to the number of the room you’re in.
That way when you need to show your inventory you can just select all the objects where location = 1. To find all the objects in a certain room, just select from the database all the objects where location = RoomNumber.
Databases are your friend, especially with something like an adventure game.
Jay [import]uid: 9440 topic_id: 26425 reply_id: 108145[/import]
im not a really great developer, but heres what i would do:
make a new icebox in ice called ‘levels’ or something
every time you finish a level, increment ‘levels’ by one
make a ‘levels’ integer value (local levels=levels:retrieve etc…)
have a pre scene file that has a function to choose which level to go to, as in
[lua]local function chooseLevel()
if ( levels==0 ) then
storyboard.gotoScene( “level1” )
else if ( levels==1 ) then
storyboard.gotoScene( “level2” )
–etc…
chooseLevel()[/lua]
hope this helps!
binc
ps: let me know if there is a better way to do it [import]uid: 147322 topic_id: 26425 reply_id: 108103[/import]