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.

  Directions: Below are the Advanced Code Blocks Links to an external site. that we reviewed yesterday that you will be using for this project.

Motion Blocks (Blue Blocks)

Go Home  sends the Sprite back to its original start spot.                       

Image of Go Home Command coding block   

Sound Blocks (Green Blocks)

POP lets the Sprite make a Pop noise. Other sounds are also an option here.

pop coding image

Sound Blocks (Green Blocks)

Play Sound lets the programmer record a sound or text.                    

play sound code image 

 

Looks Blocks (Pink Blocks)

Say Sound gives the Sprite a text bubble above their head. 

say code image 

Looks Blocks (Pink Blocks)

Appear makes the Sprite appear.     

show code image 

Looks Blocks (Pink Blocks)

Hide makes the Sprite hide from the scene.  

hide code image 

 

Control Blocks (Orange Blocks)

Set Speed  sets the speed of the sprite movement.                         

Image of Set Speed Command coding block 

End Blocks (Red Blocks)

End stops the code from progressing.                                                                                            

  Image of End Command coding block 

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. 

Image of Go to Page Command coding block 

 

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. 
    • Pink Hide and Show Blocks in Scratch Jr.
  • Add in Pink Say code block to add a speech bubble to a sprite telling something about their dream. 
    • Pink Say Block in Scratch Jr.
  • Add in Green sound code blocks to add your own words describing your dream
    • Green Sound Blocks in Scratch Jr.
  • Add in Orange Set Speed blocks to slow the movement of the sprite 
    • Orange Set Speed Block in Scratch Jr.

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

  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.