5.6 Flappy Cat Day1

This is a visual illusion. The Cat stays in place and the backgrounds move!

OBJECTIVES:




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

    • recognize that all animations are visual illusions

    • design pseudeocode for Flappy Cat

    • recognize that a sprite's position on stage is located using it's XY coordinates.

TEACHER RESOURCES:

Standards

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

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

CSTA

DO NOW:

Do Now (5 minutes)

Students watch the video Why I Code (1:51) then answer the following discussion questions:

    • How did Luna get into Computer science?

    • What does Luna say that Computer science is?

Teacher Guidance

  • Luna got into CS because she is adventurous and curious about how things work.

  • Luna says that Computer science is problem solving, thinking logically, thinking outside the box and starting things from scratch.

Mini-Lesson (5-10 minutes)

Mini-Lesson (5-10 minutes)

Today students will plan, then code to:

  • move "building sprite" across the screen repeatedly from right to left. Note: Change the building sprite's costume on each iteration.

  • move clouds across the screen repeatedly from right to left. Offset cloud speed, making it slower than building speed.

Two points to note with your students:

1. This game is a Visual Illusion: The hero seems to move, but rather the background and clouds are moving from right to left and the hero stays in the same location!

2. Co-ordinate Grid. Place building on the right hand side of screen where X coordinate is 240. Move it to the left side of screen where X coordinate is -240. Repeat.


Project (20-30 minutes)

Students design how to code the building and cloud using page 1 of the student handout

Then open chromebooks, go to student site and get started.

TEACHER GUIDANCE:

  • Spend time on the coordinate grid. This has been covered before, but is conceptually difficult.

  • Some students may find these videos helpful, accessible through the student page. videos

Close-Out (5 minutes)

Close-Out (5 minutes)

Discuss the following questions:

    1. To position a sprite at the left hand of the stage, what would be the X axis Coordinate?

    2. To position at sprite at the right hand of the stage, what would be X axis Coordinate?

    3. Do you think that visual Illusions are used in movies and games?

Potential Responses

  1. -240

  2. 240

  3. Yes,

      • Hollywood special effects teams use the term "Smoke and Mirrors". If it takes less time and money to use a visual illusion, then use it!

      • In this game, it is easier to code the hero in one place than moving forward, so we create the illusion of movement, by moving the background backwards.


TEACHER GUIDANCE: