[SOLVED]Saving scores globally.

toml2003

  • Posts: 351
I've been searching and trying to figure out saving scores and unlocked levels but I can't get my head round it.

I have a scoring system similar to Cut the Rope on iOS. So its fairly simple, and just ranges from 1 to 3 stars. After a level is completed, how do I get the game to save the score for that level and unlock the next level?

Thanks

« Last Edit: November 27, 2011, 12:15:44 pm by toml2003 »

rob1221

  • *
  • Posts: 9471
You can use a game attribute list and after each level change the value representing that level to 1-3 depending on how many starts were earned.  Saving can also be done at this time.  The default values can be set to 0 so that the levels begin locked.

toml2003

  • Posts: 351
Okay, thanks. I'm not sure how to set the ID for each scene. Heres my rough code. I have 4 Number values in my Level Scores game attributes list.

rob1221

  • *
  • Posts: 9471
You set the ID for each scene using a non-hidden number attribute and for each scene enter the level number.  Then when the level is completed, replace the value at the position representing that number.

[replace item # [level number] with [number of stars] in [level scores]]
(the main block is under Attributes > Lists)

Level number is the number of the current level, number of stars is 0-3, and level scores is the name of the list.

toml2003

  • Posts: 351
Thanks Rob, you solved it.

Does the "non-hidden number attribute" have to be a regular attribute or a game attribute?
I like making physics puzzle games.
Stay tuned for more Angry Blosics updates!
R.I.P Sploder 2007-2020
Stencyl is the new Sploder.