Discuss Scratch

yes-i-am-lanky
Scratcher
100+ posts

☛ How to create Save Level Codes ✨

Hello! Welcome to Project Save & Level Codes - In this topic, I will show you a basic tutorial on how to create Save Level Codes.

Difficulty: ★★★★☆

Firstly, what kind of data would you like to store?

Let's start by creating a simple save code with 3 variables - name, level, score
define Create Save Code (name) (level) (score)
say (join (name ::custom) (join [.] (join (level ::custom) (join [.] (join (score::custom) [.])))))

The result should look like this:
lanksy.2.681.
Now, how do you get the data back? That is the tricky part.
We will be using an iteration variable, an accumulator, and a searching variable.



The way this works: It will start saving each letter until it finds a dot, and then sets the variable it is looking for to everything the accumulator saved. Then, it loops until each variable (name, level, score) is filled out.
Hopefully you can understand from the comments.
If you have any questions or need help, feel free to leave a post!

I have also shared a project using this system: https://scratch-mit-edu.ezproxyberklee.flo.org/projects/746047332/
Feel free to remix & use it in your projects!

Last edited by yes-i-am-lanky (Oct. 15, 2022 13:27:40)

Powered by DjangoBB