SamSuka
__ess__
__ess__

patreon


Sliding Puzzle Mini-game Tutorial - Script Download!

The sliding puzzle mini-game tutorial is finished, and you can download the script here!

The sliding puzzle tutorial has finally been finished, and those of you in the Supporter tier or higher can download the script in this post below.

For those in the Voting tier or higher can also download the script containing 3 extra block formations. It will be available to download in this separate post: https://www.patreon.com/posts/sliding-puzzle-3-77810869.

Enjoy, and thank you for your support. 😊⭐

Updates

v.1.0.1 (2025-07-22) - I've moved the mini-game variables above the start label with "default" or "define" depending on the variable type.

Comments

Sounds like it's likely you forgot to include the variables needed. The last error before the "Full Traceback" section will often give you the best hint as to what's wrong. Here it says: "global name 'block_sprites' is not defined" which commonly means the variable has not been initialized/added yet. The variables are inside the start label for this script, so you'll have to remember to copy paste them into your script as well. However, I'd recommend moving the variables to above the start label instead of how I did it. This is how I do it nowadays for different reasons, as it makes it easier to work with. You'd do that by writing "default" before the variables in this case and omit the $ symbol since it's outside of the label. Ex: default block_SM = ... You can also separate the minigame into its own file to make it less cluttered in your main script file, call it something fitting (ex: sliding_puzzle.rpy) and copy all the code that has to do with the mini-game into there. Then put the variables at the bottom with "default". Just don't include the start label there as there should only be one in the main script.rpy file. I'll update the script for this as well now right away and upload it as a newer version. I tend to go back to my older scripts and do updates like these, but haven't gotten around to this one yet. Hope this helped! Read more about variables in Ren'Py: https://www.renpy.org/doc/html/language_basics.html#python-expression-syntax

Sara

Hi Ess! Thank you so much for the script. I had a question.. when I try to input the script in my game, it gives me an error. I'm sorry, but an uncaught exception occurred. While running game code: File "game/script.rpy", line 1712, in script $create_blocks() File "game/script.rpy", line 1712, in $create_blocks() File "game/screens.rpy", line 1576, in create_blocks for block in block_sprites: NameError: global name 'block_sprites' is not defined -- Full Traceback ------------------------------------------------------------ Full traceback: File "game/script.rpy", line 1712, in script $create_blocks() File "/Applications/renpy-7.4.11-sdk/renpy/ast.py", line 928, in execute renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store) File "/Applications/renpy-7.4.11-sdk/renpy/python.py", line 2245, in py_exec_bytecode exec(bytecode, globals, locals) File "game/script.rpy", line 1712, in $create_blocks() File "game/screens.rpy", line 1576, in create_blocks for block in block_sprites: NameError: global name 'block_sprites' is not defined I'm just a bit confused because I copy pasted the script from your example, and everything was working fine in the test game, so I don't know why it wouldn't work in my established game. Are you supposed to edit something else? I'm very new to coding so I apologize if this is a stupid question. ^^' Thank you!

strawbxrryz


More Creators