3.3 Race to Finish

Second day of Race to Finish. Students will complete the scripting of their "Race to the Finish" game with the aid of their pseudocode. Then Race!

OBJECTIVES:



OBJECTIVES: By the end of this lesson, students will:

    • build an interactive Race to the Finish game

    • implement "IF" statements in script

    • recognize that the shape of a Scratch block relates to it's function.

TEACHER RESOURCES:

Standards

    • CSTA 2-AP-12: Design and iteratively develop programs that combine control structures, including nested loops and compound conditionals.

    • CSTA 2-AP-19: Document programs in order to make them easier to follow, test, and debug.

CSTA

DO NOW:

Do Now Diversity in Technology (5 minutes)

    1. Watch "Careers in Tech: My name is Brina" (1:41)

    2. Discuss:

      • Where does Brina work? What is her job there?

      • Brina did not always like coding. When and why did she start liking it?

      • What does she say computer science is?

TEACHER GUIDANCE: Brina is a software engineer at Instagram, working on the Android app. Brina started enjoying coding after graduating from college when she was able to use it to make something visual (like a website). She says computer science is a way to impact the world.

Mini-Lesson (5-10 minutes)

This is the second day of a two day project.

In lesson one, students created their game assets. In lesson two, students will code their racing game!


Concept Building

This is the first occasion that students use an IF statement in code.

Things to note:

1. Have students trace their finger through an IF loop and answer some questions. student handout Page1.

2. Point out that each time the sprite moves forward, we retest the IF statement. This makes sense since the sprite has changed it's location.
( Note: Continually testing an IF statement, is an important emphasis of later lessons)

3. Notice that the IF statement only allows hexagon shaped blocks to fit in it's conditional slot. This makes sense since an IF statement needs a TRUE or FALSE condition, and Hexagon pointy edged blocks in scratch are Boolean, with only two states.



TEACHER GUIDANCE: The shape of a scratch box tells it's function

Pointy edged l blocks are conditions that return a boolean value of either TRUE or FALSE.

Pointy edged block fit into conditional statements.

Circular blocks ( variables ) return a number or character(s).

Project (20-30 minutes)

Game Building

Students work on coding with their partners from day 1, using student handout Page2.


Showcase and Feedback

If time permits, have teams solicit feedback from others during a gallery walk.

Receiving constructive feedback, code iterations and designing for a target group, are foundational skills in program development.


Sample questions:

Did you know what to do? How could the game be easier to use? (Potential answers below)

  • Add Instructions.

  • The key chosen to move right is a standard move right command known to the tester. eg. D and right Arrow - used in gaming.

What would you add to the game, if there was more time? (Potential answers below)

  • Add animation to the forward movement.

  • Add animation or sound "reaction" when sprite touches the finish-line.

  • Add a third racer

  • Add a counter, showing who won.

  • Add a second level



This is the first game students have completed. Students love racing against each other.

If you have already introduced MakeyMakey ( Intersession E), students could hook them up for the gallery walk.

"Don't just buy a new video game, Make One. Don't just download the latest app. Help design it. Don't just play on your phone, Program it." Obama 2013.

Your students have made their first game! Celebrate and showcase.

Close-Out (5 minutes)

Close-Out (5 minutes)

Discuss the following questions:

          • Why do we like to use the green flag as our reset button?

          • Touch is a sense. Where do you find touching command.

          • Touching command is a hexagonal block with pointy edges, Why, hat does it represent?


Potential Responses

  • Using the Green Flag as reset/start/play is a convention in Scratch. Green for go, Red for stop. The symbo is also associated with play and stop symbols, reinforcing this convention.

  • The Touching command resides under the blue Sensing blocks.

  • Touching command is a hexagonal block with pointy edges. Hexagonal blocks return a Boolean value of either False or True.