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:
Objectives/Outcome
What Can You Make with 10 Squares?
Prerequisites:
Students should have foundational understanding of:
Vocabulary
Decompose
Project Sample
Project Sample
conditional
decompose
This small piece of the code creates that shape.
What shape is repeated to make this design?
sequence
Next
First
Then
Last
Planning on Google Sheets
Know Your Blocks
You will use
You might use
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.
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.
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?
Step-by-Step
Go to Clever
Open Code HS
Select the “10 Squares” Project
with blocks pre-made
blank project (make your own blocks)
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.
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
Step-by-Step
3. Duplicate the sprite 10 times
HINT: Right Click on the sprite and select “duplicate”
Step-by-Step
4. Arrange the 10 square sprites on the stage in a starting design.
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.
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…
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.
Step-by-Step
9. Add additional code blocks to add sound/music, create additional animations, change colors, or add other effects.
Tutorials
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?
CODE BLOCKS
Go to
Wait
Glide
When clicked
SKILLS
VOCABULARY
Decompose
Sequence
Vocabulary
Code Blocks
Skills
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