Discuss Scratch

chopbot
Scratcher
81 posts

save code

how to make a save code?

“hope is like a soap, use it every day”

-Chopbot
say [follow me?]
deck26
Scratcher
1000+ posts

save code

Working out what you need to save is the key to this. What do you need to be able to go back to the desired point in the game - eg this may include lives, points/coins, level and inventory items. You need to save this in an unambiguous form so you can be sure you get the same information back.

If you don't use a separator - eg 23:4:92 you need to know whether 23492 indicates 23, 4, 92 or 2, 34, 92 or some other set of values. Using fixed numbers of digits for particular values can be useful. So perhaps the first value might go up to 199 so we allow 3 digits, the second is only 1 digit and the third is up to 999. In that case our code becomes 0234092.

Having addressed those issues you also need to decide whether you want to disguise the code to make it harder to cheat. That can be done in various ways but anyone can look inside your project and work out the code for any set of values.
chopbot
Scratcher
81 posts

save code

Thank you, sir!

“hope is like a soap, use it every day”

-Chopbot
say [follow me?]

Powered by DjangoBB