15 Years!

Tools of the Trade: Scratch

This Tool of the Trade is a great way to get started with programming if you haven’t done any yet. It’s the perfect way to get started with basic programming concepts without worrying about exact spelling and command syntax. You can work with variables, loops, conditions, passing messages, and more! Scratch is a free tool available for Windows, Mac, and Linux and even has a special version for Raspberry Pi! It’s visually-oriented with all programming done by dragging and dropping elements and connecting them together. It’s also very animation-oriented like Stencyl so you create your scene (a stage), characters (actors), and character sprites (costumes). Then you can tie into the mouse or keyboard to see what the player what’s to do.

Setting the Scene

The game is centered on the playing area — the stage. You create your character actors and drag them in place, or create variables to hold information like scores or number or lives and put them in place too. Anything that moves is an actor so you use this same idea for cars or trees or other elements. You can set items to be invisible until something happens, and you can Levels can be a single screen, or you can create a scrolling background with some work. Many people start with simple things like making a character walk across the screen or showing a message.

Directing the Action

Everything that you drag onto the screen can be controlled in the code. Drag a Movement action over and connect it to the player so you can set or change its location, size, rotation, or other properties. Other actions let you perform math or compare things to each other. You can create a loop (where things happen more than once) where you see if things are touching each other or have made it to a certain spot on the screen.

Putting the Player in Control

Once you have the stage set and you’ve created basic rules for the game, you add some code to react to the user. This is where you check to see if they have pressed a key or moved the mouse a certain way. For example, if the user presses the right arrow, you can increase the “x” value of the player’s sprite to make it move to the right. There are enough command blocks that you can do amazing things with movement, sounds, speech bubbles, and more.

Joining a Community

Finally, you can check out lots of great games and things that people have created by visiting the web site: http://scratch.mit.edu. You can run them in a web browser or make a copy to work with in Scratch. Then you can add new things to it or change it to be just the way you like it. There are many opportunities to try new things and learn other ways to get stuff done.

If you already love your development tool, then Scratch probably isn’t for you. If you are a first-time coder, especially on a middle-school team, Scratch is well worth looking at. You’ll build up your development skills, learn structure, and figure out how to think like a coder. Having it all in a visual interface makes it easy to see what’s happening. Once you learn how to create games in Scratch and decide you need more power, then you can move up to Stencyl. Download it for free and give it a try!