In Getting started with Scratch, we familiarized ourselves with the different regions of the Scratch screen. Before we jump into the development of our first game, let's talk a little bit more about some of the fundamental ideas involved in writing Scratch programs. It is also a good idea for you to read through the Scratch Getting Started guide and to browse through the Reference guide before proceeding. These guides are available in every Scratch installation, and can be accessed by clicking the button that is located on the top-center of the Scratch screen.
Scratch programs are organized within projects. When you start out to create a new game or animation, you create a new project. You then do the following (but not necessarily in this order):
- Come up with an approximate storyline for your game.
- Kinda decide what the characters in your game are, and what they will do during the course of the game.
- Decide what your game background should look like, and load the background.
- Create a new Sprite for each character.
- Write scripts for each of your Sprites. These scripts determine how your Sprites behave and interact with each other.
- Get everything working.
- If you're satisfied with the result, you're done! If not, go back to step 1 and refine the game by giving the Sprites richer behavior and/or extending the storyline.
When you work with Scratch, you'll be spending a lot of time working on the scripts for your Sprites. So it pays to know what actions are available to you in your scripts.
Scratch provides a visual programming language. The blocks available in the blocks palette on the left of the Scratch screen are the building blocks of this language. Each block defines an action that you can ask the system to take on behalf of your Sprite.
Scratch has eight different categories of blocks. Let's talk a little bit about each category:
- This category contains blocks to move, animate, and bounce a Sprite.
- This category contains blocks to help with event handling and broadcasting, and the general area of flow control, including conditionals and looping. This is an important area for budding programmers to understand, but we are not going to spend any time right now digging into these somewhat dry details; we will instead talk more about these concepts as we encounter them while building our first live game.
- This category contains blocks that control the appearance of a Sprite. This includes changing costumes, colors, graphic effects, size, and visibility.
- This category contains blocks that help a Sprite to sense its environment. This includes sensing mouse movements and key presses, and proximity to and collisions with other sprites.
- This category contains blocks that help Sprites to make predefined or recorded sounds, play different kinds of drums and musical instruments, and change the volume and tempo of the sound.
- This category contains blocks that help Sprites to reason with numbers and booleans (or truth conditions). This relates to concept of the type of a value within a program; we'll discuss this further when we work on our first game.
- This category contains blocks that allow a Sprite to trace its movements across the world, and stamp its image.
- This category allows you to use variables and lists to control the behavior of your sprite; we'll discuss this further when we work on our first game.
This would be a good time for you to spend a few minutes looking at the blocks in each of the eight categories described above.
Tip: you can right click on any block to access help information for that block.
Local Navigation Map:
Current Page: 2. Scratch Basics