It’s time to start coding!
In this module we’re going to explore the Scratch programming language.
With Scratch, you can program your own interactive stories, games, and animations — and share your creations with others in the online Scratch community.
Let’s do this thing.
Upon completion of this module, you should be able to:
.sb2 file for assignment submission.
Scratch is a programming language and online community where you can create your own interactive stories, games, and animations – and share your creations with others around the world.
In the process of designing and programming Scratch projects, you will learn to think creatively and reason systematically.
The programmings skills you develop with Scratch will help you better understand the Java coding we do in the second half of this course.
It is recommended that you read through this Introduction to Scratch Tutorial.
To start coding with Scratch you’ll want a Scratch account:
Visit the Scratch Homepage.
Click the “Join Scratch” button.
Pick and username and password.
Don’t forget your password. :)
Let’s build a simple program.
Scratch programs are coded by dragging blocks into the Scripts area. Blocks are categorized by colour according to their behaviour.
The cat should say “Hello World” for 2 seconds.
Build the program shown here. Click the green flag once you are done.
Each object in Scratch is called a sprite.
The cat you see in when you start Scratch is an example of a sprite.
Sprites can be controlled with code and can have multiple costumes.
Every Scratch program also has a stage.
The stage can also have associated code and multiple backdrops.
In programming, a statement is a directive that tells the computer to do something. You can think of it as a command or an instruction.
In Scratch, any block whose label reads like a command is a statement.
Scratch statements can be connected together. Blocks that are connected will execute one at a time from top to bottom.
You’ll know if you can snap two blocks together if they fit together like a puzzle piece.
Scratch blocks are coloured and grouped by category.
The list of categories can be seen in the image on the right.
Right-click on any block and select “help” to learn more about it.
Comments are the parts of our code that are ignored by the computer but are important for people.
Comments let us write notes to ourselves and to any others who may read our code. These notes allow us to document our design decisions and to explain complex portions of our code.
In Scratch we can attach comments directly to the blocks they describe by right-clicking a block and selecting “add comment”.
We can also add comments that are not attached to specific blocks by right-clicking the background of the coding area and selecting “add comment”.
The following resources can be used to learn more about coding in Scratch:
Scratch is available on the web but it can also be installed as an offline application.
The web version is Scratch is available at scratch.mit.edu.
The offline version of Scratch can be downloaded at scratch.mit.edu/scratch2download/.
Differences between the online and offline versions.
Online Scratch:
Offline Scratch:
Your Scratch assignments will be submitted digitally using the Learn dropbox. For each assignment you will be submitting one or more .sb2 files.
If you have been working with the online Scratch you will need to download your code to your computer before you submit it:
.sb2 file to a know location on your hard-drive.If you have been working with the offline Scratch program you will have been saving your work to your hard-drive in this format already.
You now have enough Scratch knowledge to start working through the built-in Scratch tutorials.
In week five of the course you’ll complete your first Scratch assignment and then begin work on your Scratch Project.
Before you start your Scratch Project it is recommend that you work your way through this game tutorial to experience what is involved with coding a simple game in Scratch.