2-1 Beginning Motion in Scratch

Objectives:
  • Students will get acquainted with mazes and coding basics in Scratch and learn how to program a character through a maze.
  • Students will learn gain comfort with graphical programming, and dive into the thought process of coding.


Engage

Watch this short video on Scratch:

YouTube Video





Scratch Basics: Block Review


Scratch Blocks Review

When Clicked - this is the first block Scratch reads when the green flag icon is clicked.

Win - this block checks if the sprite is at the end position. If the sprite is at the end position, you win.
Reset - this returns the sprite to the start position.

Many blocks move the sprite in the cardinal directions:
  • Up - this moves the sprite one block up.
  • Down - this moves the sprite one block down.
  • Horizontal Block - this moves the sprite a number of blocks in the vertical direction. Positive numbers move the sprite up. Negative numbers move the sprite down. For example, to move the sprite 5 blocks to up, type 5 into the block. To move the sprite 5 blocks down, type -5 into the block.
  • Left - this moves the sprite one block left.
  • Right - this moves the sprite one block right.
  • Vertical Block - this moves the sprite a number of blocks in the horizontal direction. Positive number move the sprite to the right. Negative numbers move the sprite to the left. For example, to move the sprite 5 blocks to the right, type 5 into the block. To move the sprite 5 blocks to the left, type -5 into the block.


Explore Ocean World in Scratch

Motion in Scratch: Explore Ocean World



One Direction in Scratch

Motion in Scratch One Direction Scratch Lesson
Open One Direction from the link above and create the sequence of blocks illustrated below.
Press the green flag to see this script run.
1.1 Solution
  • It has to have the "Win" block at the end to check if it is reached the end.
  • If you do not reach the end, click the "Reset" block in the block menu to send the sprite back to the start.

Basic Motion: Up, Down Left and Right Blocks


Using the "Up", "Down", "Left", and "Right" blocks do levels 1.21.31.4, and 1.5.


Repeating in Scratch

Write the following code for "1.6 5x3".

Note how it is incredibly long, so you can write the code below to do the exact same thing.

    View Full Size Image

The "Repeat" block allows anything inside to be repeated a certain number of times before going on. This makes the code a lot shorter.

More Up/Down/Right/Left

Using "Up", "Down", "Left", "Right", and "Repeat" blocks, do levels 1.71.81.9, and 1.10.


Check Your Understanding

  • Notice how the "Repeat" block makes the scripts considerably shorter than before.
  • This basic command can be used to maneuver any sprite in Scratch. It will continue to be a fundamental piece in the rest of the puzzles.