Grade 2 CT • Coding Your Dream • Day Two
Grade 2Computational Thinker Coding Your Dream
DAY 2
Overview
Today I will add advanced coding elements and identify patterns in the code to debug any coding errors.
Lesson
Today we will be continuing to add code to our Dream project.
STEP 1.
Advanced Code Blocks Links to an external site. that we reviewed yesterday that you will be using for this project. Directions: Below are the
Motion Blocks (Blue Blocks)
Go Home sends the Sprite back to its original start spot.
Sound Blocks (Green Blocks)
POP lets the Sprite make a Pop noise. Other sounds are also an option here.
Sound Blocks (Green Blocks)
Play Sound lets the programmer record a sound or text.
Looks Blocks (Pink Blocks)
Say Sound gives the Sprite a text bubble above their head.
Looks Blocks (Pink Blocks)
Appear makes the Sprite appear.
Looks Blocks (Pink Blocks)
Hide makes the Sprite hide from the scene.
Control Blocks (Orange Blocks)
Set Speed sets the speed of the sprite movement.
End Blocks (Red Blocks)
End stops the code from progressing.
End Blocks (Red Blocks)
Go to Page ends the code and then moves to another page. The number at the top right corner, is the page it will go to.
Activity
STEP 2. ADVANCED CODE
Directions: Follow along with your teacher to add some of the advanced coding elements that we just learned about to your project.
- Add in Pink Hide/Appear code blocks for objects/sprites that may have come back with you from the dream.
- Add in Pink Say code block to add a speech bubble to a sprite telling something about their dream.
- Add in Green sound code blocks to add your own words describing your dream
- Add in Orange Set Speed blocks to slow the movement of the sprite
STEP 3. DEBUGGING
Directions: People make mistakes all the time. Debugging is running code, finding the mistake, and fixing that code to run correctly the next time. Now that our dream code is complete:
- run it (using the green flag) to watch the dream
- note any mistakes in the code that need debugging
- return to the page and the character/sprite and fix the code
- run it again to check for any other bugs
Resources
This course content is offered under a CC Attribution Non-Commercial Share Alike Links to an external site. license. Content in this course can be considered under this license unless otherwise noted.