Quick tutorial on the `settings` namespace

I had mentioned a few days ago that I’d update this thread, now that the settings namespace is supported in Blocks.

To add the necessary blocks, install the settings-blocks extension in your project.

The extension adds a new drawer to the toolbox, called settings. In this post, I’ll focus on the four blocks at the top of the drawer.

As in my original post, let’s say you want to ask players for their names and ages. You could do something like this:

Then, somewhere else in your game, you could read that information:

Here’s a more complete example, then, with these ideas in mind:

You can play with the code here:

Run the game once so that the game can store the appropriate settings. Then, run it again, and notice that the game does not prompt you for your name. The information is saved in storage that is associated with the game, and so the information is available even after the game ends.

As with JavaScript, the settings drawer has additional functions to store other things, like arrays.

Have fun!

2 Likes