1 of 23

Objective: Students will be able to view a sample project and decompose and reverse engineer the code used to create their own version. Students will learn the glide movement block.

Expected Outcome:

Students will be able to:

  • add sprites
  • code a sprite to glide from one location to another
  • use wait block to coordinate timing and sequencing
  • use creativity to develop a personalized version of the sample project

Objectives/Outcome

What Can You Make with 10 Squares?

Prerequisites:

Students should have foundational understanding of:

  • adding sprites
  • basic movement blocks
  • wait blocks

Vocabulary

Decompose

2 of 23

Project Sample

3 of 23

Project Sample

4 of 23

conditional

decompose

  • To break down a program or problem into smaller pieces.

This small piece of the code creates that shape.

What shape is repeated to make this design?

5 of 23

sequence

  • a set of actions or events arranged in a specific order

Next

First

Then

Last

6 of 23

Planning on Google Sheets

7 of 23

Know Your Blocks

You will use

You might use

8 of 23

What can you do with Glide?

New Blocks - Glide

Glide moves a sprite at a steady pace to a chosen location in a chosen number of seconds. A disadvantage of the glide block, however, is that it pauses the script while the sprite is moving, preventing the script from doing other things while the sprite is gliding.

You can type specific numbers in these spaces

You could also add different operators to the spaces for more options

Use the dropdown on this glide block to make a sprite glide to a random position, glide toward the mouse, or glide to another sprite.

9 of 23

What are X and Y?

Coordinates

Coordinates - the stage is a four quadrant grid. The coordinate (0,0) is in the center of the screen. The X and Y positions can be coded with a variety of blocks. When you click on any sprite, you will be able to determine its position by looking a the coordinates listed below the stage.

  1. Like in math, X determines left and right, and Y determine up and down
  2. -X moves to the left
  3. +X moves to the right
  4. -Y moves down
  5. +Y moves up

10 of 23

10 squares

Decompose

Add sprites (draw a square in sprite editor) and background

Move sprites to starting locations add an event and a “go to” block

Make sprites move to new location

Duplicate square sprite 10 times

Note: Not all blocks that might be used are shown here. There are multiple ways to code this project.

Add sounds and extra animations

What are some of the code blocks I need?

11 of 23

Step-by-Step

Go to Clever

Open Code HS

Select the “10 Squares” Project

with blocks pre-made

blank project (make your own blocks)

12 of 23

Step-by-Step

1. Add one sprite by going to the sprite editor and drawing a shape

HINT: hold down the SHIFT key while to drag the shape to create a perfect square.

13 of 23

Step-by-Step

2. Set the color and outline preference

HINT: Click this box to turn off the outline

HINT: Slide the sliders around to select a fill color

Click the outline tool

Click the fill tool

14 of 23

Step-by-Step

3. Duplicate the sprite 10 times

HINT: Right Click on the sprite and select “duplicate”

15 of 23

Step-by-Step

4. Arrange the 10 square sprites on the stage in a starting design.

16 of 23

Step-by-Step

5. Code the starting position for EVERY sprite square. This will also serves as a “reset” to help you as you code movements.

NOTE: All 10 sprites will have different coordinates. The coordinates for your sprites will be different than the ones shown here.

HINT: you can always find the current location of any sprite by selecting the sprite and looking at the coordinates here.

17 of 23

Decompose/Sequence

Can you figure out how to use these blocks to make your 10 squares move from one configuration to a new configuration?

Remember: your coordinates will be different than those listed here.

*Don’t forget to put code on EVERY sprite.

*TEST, DEBUG, TEST, DEBUG…

18 of 23

Step-by-Step

6. Rearrange ALL 10 of the square sprites to a new configuration.

7. Using wait blocks and glide blocks, add code to EACH sprite to move it to the new coordinates.

8. Repeat step 5 and 6 for new configurations.

19 of 23

Step-by-Step

9. Add additional code blocks to add sound/music, create additional animations, change colors, or add other effects.

20 of 23

Tutorials

21 of 23

Revise

Can you change the colors of the squares in different formations (HINT: use costumes?

Can you add different effects (spin, grow, etc)?

Can you add music or sound effects?

10 Squares

Can you control the speed objects spin?

Debug

Does everything work the way you want it to?

Is there anything you want to change?

Can you add background changes?

22 of 23

CODE BLOCKS

Go to

Wait

Glide

When clicked

SKILLS

VOCABULARY

Decompose

Sequence

Vocabulary

Code Blocks

Skills

  • Create an algorithm
  • Use sprite editor to create sprites
  • Create original sprite configurations
  • Sequence code and coordinates to change configuration

Standards

STANDARDS

CS 3AP-3b Create programs that include sequences, events, loops, and conditionals

CS 3AP-4a Break down (deconstruct) algorithms and list the steps needed to solve a problem into a sequence of tasks and sub-tasks.

CS 3AP-5e Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended

23 of 23

Slidesgo

THANKS

Sources:

scratch.mit.edu

thenounproject.com

freepik.com

code.org

Pam Hyer

CREDITS: This presentation template was created by Slidesgo, including icons by Flaticon, infographics & images by Freepik