4.3 Maze Incentives Day3

Students collect treasure. Students will use a variable to set and increment the score as each object is collected.

OBJECTIVES:



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

    • Applying the game play concepts of reward, user collects treasure items in the maze.

    • Define and increment a variable to keep track of items collected in maze.

TEACHER RESOURCES:

Standards

    • CSTA 2-AP-10: Use flowcharts and/or pseudocode to address complex problems as algorithms.

    • CSTA 2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.

CSTA

DO NOW:

Do Now Digital Citizenship (5 minutes)

    1. Watch What’s In Your Digital Footprint (1:07)

    2. Discuss:

      • What is your digital footprint?

      • What are four things that can happen to your digital footprint?

      • Can you erase your digital footprint?

      • Have you ever had an experience when something you said or did online was copied and shared?

Teacher Guidance

  • Your digital footprint is the trail of data that you create while using the Internet. It can be searched, copied, shared and broadcast. It is difficult to erase, and most times in is permanent.

Mini-Lesson

Using this student handout, students collect items as they move around maze.

For teacher mini lesson, use slide deck.

For step by step student instruction use this slide deck. ( Suitable when students need to catch up due to absences)

Tip: Make code work for one treasure sprite. Then duplicate the sprite and code will also duplicate!

Project (20-30 minutes)

Differentiation: Simplify the lesson for struggling students by collecting items without adding to a Score variable.
Both games have a finished feel. Demo:
Maze without variables. Demo: Maze with Score.
Seeing classmates work with variables, helps the concept soak in and perks interest. (In unit 5 all students will explicitly work with variables.)


Spicy Challenge:

Only finish level if hero has collected all items AND hero is touching end sprite:

Note: This spicy challenge allows practice with conditionals and builds experience working with variables.

The Power of Context:

Advanced concept like variables, can be made more accessible if rooted in activities that are personally meaningful.

Mitch Resnick's, creator of Scratch at MIT:

“A few years ago I was at one of our Computer Clubhouse afterschool centers and I saw a 13-year-old boy working on creating his own game. He was able to control a character, in this case, a fish. He wanted the game to keep track of the score, so you could see how many little fish had been eaten by the big fish, but he didn’t know how. I saw this as an opportunity to introduce the idea of variables. I showed this to him and he immediately saw how he could use this block to keep track of how many fish had been eaten in his game. He took the block and put it in the script right where the big fish eats the little fish. He quickly tried it. Sure enough, every time the big fish ate a little fish, the score goes up by 1. I think that he really got a deep understanding of variables because he really wanted to make use of it. ...We see that kids get a much deeper understanding of the concepts they learn when they are making use of the concepts in a meaningful and motivating way.”

Close-Out (5 minutes)

Close-Out (5 minutes)

    1. Discuss the following questions:

    • If you duplicate a treasure sprite, does it also duplicate the sprite code?

      • Why are variables useful? How would you describe variables to someone else?

Potential Responses

  1. Yes, when you duplicate a sprite, it duplicates all scripts and costumes.

  2. Variables are placeholders that store information that changes. Variables allow people to store and manipulate data within a program. They can be used multiple times within a program. Some examples of variable usages are: keeping score, setting line widths, and gathering input from the user.