DEV Community

Cover image for Make Scratch Professional
Wj
Wj

Posted on

Make Scratch Professional

Remember that elementary school coding class?

Yep, we used scratch. A kiddy like, coding block platform you can code on a web-app, website or an actual app. Yeah. It was awesome. I still use scratch to make games nowadays, but now, we have an EXPLOIT!

Of course, not hacking...

but still it is really kool. Scratch is a web thing. So, expectedly, it uses web stuff. It uses JS, HTML and stuff. And it has a file format called ".sb3" to download to your computer to do edits offline on the scratch app.

Here's a little secret on the ".sb3" file format

Just like any NEW file format, it is a ".zip" file. And, to be honest, it is EXTREMELY simple to script ".sb3" files. In a ".sb3" file you download from a blank project, there would be a few files

  1. JSON file as data for the scripts
  2. Some assets, only some ".mp3"'s and ".svg"'s for sounds and images respectively

So THAT'S juicy

So, how do we extract these juicy code files? Simple. Rename the ".sb3" file to a ".zip" file.
rename
Extract all:
extract
Viola!
files

So, what do we use to reach the juicy code?

Open the JSON file in a code editor, there would be a SINGLE line of JSON code (good luck organizing it). Scratch makes it practical and easy to understand the JSON as long as you have used scratch a few times and after reformatting the JSON file a bit, it would look like this:
reformat


Do some edits to the JSON, and maybe add some .mp3 or .svg files to make your project even juicier!

I want to put them in scraattcchhh

So, finished your code. Now, just reverse-engineer the file. Re-zip and change file ending to a ".sb3"! Now, you can upload it on scratch.



Why would you want to do all these work?

If you like being a five-year old and want to spice up your games or upload them on GMTK 2022 on twitch but you can't with a website? THAT is the beauty. Convert it, add some servers and clients, and you are able to do that.


At the point of writing, these are the only features to remotely edit files on scratch out of scratch website or web-app or desktop app or mobile app or... But, you get it. I really wish that Scratch would add more customization on scratch 4.0.



How many times did I put "juicy/juicier"?

Top comments (0)