0% found this document useful (0 votes)
22 views

Lesson 7 - Panda - S Travel - Lesson Plan

Uploaded by

naicker.e
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Lesson 7 - Panda - S Travel - Lesson Plan

Uploaded by

naicker.e
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Lesson 7

Panda’s Travel

Subject: Computer Science

Level of Difficulty: Beginner


Duration: 45 minutes

Objectives
By the end of class, students will be able to…
● create a program in mBlock which incorporates a conditional statement;
● use motion blocks to control the rebound and rotation of a sprite;
● define conditional statements;
● describe the functionality of a computer program.

Overview
In this lesson, students create a mBlock project that showcases places that Panda has visited on Earth.
Students help Panda turn around and walk in the opposite direction when reaching the edge of the
stage. Using a conditional statement, students program mBlock to decide to run specific blocks only
when a condition is true.

Key Focus
● Use conditional statements to decide whether to run specified blocks.

Pre-lesson Checklist
For Teacher:
● A computer with mBlock software installed or access to the mBlock software website
● Slides Presentation: Lesson 7 – Panda’s Travel - Visual
For Student:
● A computer with mBlock software installed or access to the mBlock software website

Standards
● CSTA 2-AP-13: Decompose problems and subproblems into parts to facilitate the design,
implementation, and review of programs.
● ISTE-1D: Students understand the fundamental concepts of technology operations, demonstrate
the ability to choose, use and troubleshoot current technologies and are able to transfer their
knowledge to explore emerging technologies.
© education.makeblock.com
1
● ISTE-5C: Students break problems into component parts, extract key information, and develop
descriptive models to understand complex systems or facilitate problem-solving.
● ISTE-6A: Students choose the appropriate platforms and tools for meeting the desired objectives
of their creation or communication.
● ISTE-6B: Students create original works or responsibly repurpose or remix digital resources into
new creations.
● ISTE-6D: Students publish or present content that customizes the message and medium for their
intended audiences.

Lesson Plan

Warm-Up [10 min]


In the previous class, we created the Penalty Kick program to animate Jordyn kicking the soccer ball in a
few different ways. To create this animation, we programmed the position and the movement of the soccer
ball sprite.

To create the program, the following blocks were used;


Block Function

Control the sprite to change its costume


into the specified costume.

Moves smoothly to a specified position at


the stage in a specified time.

Display the hidden sprite.

Hide the sprite.

Panda is learning so much about our culture during his time on Earth. But Panda wants to learn more. So
Panda decided to take a site-seeing trip and took many pictures along the way. Help Panda prepare a
slideshow of all of the exciting places visited on his trip.

© education.makeblock.com
2
Explore a mBlock Program – Panda’s Travels
1. Play the video recording of the program Panda’s Travels.
2. Have the students write an explanation of the program. Use the following to guide the student if they
need additional support.

a) What action does Panda perform when the program starts?

■ Panda changes costumes creating a walking animation.


■ Panda moves forward.
b) What happens when Panda reaches the edge of the stage?

■ Panda bounces/moves in the opposite direction when reaching the edge of the stage.
■ Panda rotates or flips to the opposite direction when reaching the edge of the stage.
■ Background changes when Panda reaches the edge of the stage.

Note, this example program is the example for the Independent Practice for this lesson. Take care not to
show the code to the students during this portion of the lesson. A video recording of the program has been
provided for your convenience.

Assessment
● Review the students' work. Were they able to describe the functionality of the program?

Hands-On [15 min]

Bounce and Rotation


Have your students work together in pairs to create the following programs and observe what action occurs
when you run each of these programs:

Program #1 Program #2 Program #3

© education.makeblock.com
3
Assessment
Have students write a paragraph or diagram comparing and contrasting the programs above. You can also
have students write out a pseudocode (a short description) of each of these programs.
Make sure students provide an accurate description of the following blocks:

Some of the observations about the blocks above that students should be able to explain are:
● These blocks allow a sprite to appear to turn around instead of getting stuck at the edge of the
stage.
● The left-right rotation style keeps the sprite from turning upside down when it bounces on the edge.

Block Area Block Function

If the sprite touches the edge of the


stage, it will “bounce” and move in the
opposite direction.

Set the rotation style of the sprite.

If time permits, encourage students to try the other two rotation forms and observe the different effects.

© education.makeblock.com
4
Conditional Statements
Play a game similar to Simon Says with your class to demonstrate conditional statements.

With your students, read each statement below and have the students obey the command. (Feel free to
write your own commands for your students.)
1. IF your name has the letter “S” in it, THEN raise your hand.
2. IF you have a pet cat, THEN clap your hands.
3. IF you play a sport, THEN stomp your feet.
4. IF you are wearing socks, THEN touch your feet.
5. IF your favorite ice cream is chocolate, THEN say “Yum.”

Share with students that these commands are examples of conditional statements. In programming, conditional
statements are used to perform specific actions if a condition is true.

In previous lessons, Event blocks were used to trigger a program. We have learned to use these two Event

blocks and the block to trigger the start of a program.


Similarly, when a program is already running, we can use a conditional statement to decide whether to run
a set of program blocks. If the condition specified is true, then the program blocks nested inside the
conditional block will be triggered to run.

Program Description

1. Start the program.


2. Show the sprite.
3. Check if the condition is true. If the
condition is true, run the code inside
the conditional block.
4. Repeat steps 2 & 3 until the program
is stopped.

Blocks
Block Function
Area

Conditional statement “if XX, then…”


that checks whether a condition “XX” is
met. If the condition is met, then
proceed to execute the sequential
action nested inside.

© education.makeblock.com
5
Sensing block used in a conditional
statement to determine if a condition is
met.

Instruct the students to write their program according to the steps below:
1 Find and select the appropriate blocks from the Block Area to create the following program.

2 Click the in the Stage Area to run the program. Move the mouse pointer back and forth over
Panda to observe the effect of the program.
3 Have students describe what happens when the mouse is moved around the stage.

Loops & Conditional Statements

Notice that the example program has the conditional statement nested inside of a loop.
Could this program have worked if the blocks weren’t inside the loop? Review the examples and
explanations below:

© education.makeblock.com
6
With a Forever Loop Block
1. Start the program.
2. Show the sprite.
3. Check if the condition is true. If the
condition is true, run the code inside
the conditional block.
4. Repeat steps 2 & 3 until the program
is stopped.

This program always or repeatedly


checks to see if the condition is true.
The blocks inside the conditional
statement may run more than once.

Without a Forever Loop Block

1. Start the program.


2. Show the sprite.
3. Check if the condition is true. If the
condition is true, run the code inside
the conditional block.
4. Stop the program.

This program only checks once,


immediately when the program starts,
if the condition is true. The blocks
inside the conditional statement may
run up to one time if the mouse pointer
is touching the sprite when the
program is started.

Try It [15 min]

Changing a Stage Background


Quick Tip: A mBlock program can have multiple backgrounds, similar to how each sprite can have multiple
costumes. The following programming blocks are used to change the background:

Notice, these blocks are very similar to the blocks used to change a sprite’s costume. Encourage your
students to use their prior knowledge of programming a sprite to change costumes to the Panda’s Travels
project.

Independent Practice
Instruct the students to complete the program, Panda’s Travels. Their final project should do the
following:
● Trigger Panda to walk across the stage (while changing costumes).

© education.makeblock.com
7
● Program Panda to turn around instead of walking off the edge of the stage. Make sure Panda
doesn’t turn upside down.

● If Panda touches the edge, change the backdrop to a new location. Showcase at least 5
different locations Panda has visited.

● Set a starting position for Panda.

● Set a starting backdrop.

If your students need additional assistance, provide them with this list of blocks below that they can
use to complete the Panda’s Travels program.

Example Program Code – Panda’s Travels

Extension Activity
Challenge students with remaining time to do one or more of the following:

© education.makeblock.com
8
● Add a new sprite to create a title for Panda’s Travels slideshow.

● Program Panda to say the location when the backdrop changes.

● Add a friend who travels with Panda to all of the locations.

Wrap-Up [5 min]

Quiz
(1) Which of the programs below can make the character to speak “Hello” for 2 second?

Answer: C

(2) What condition needs to be met to make the sprite disappear?

A. When the green flag is clicked B. When the character touches the mouse pointer
C. When the stage touches the mouse pointer D. When blocks touch the mouse pointer
Answer: B

(3) What’s the shape of a conditional block?

© education.makeblock.com
9
Answer: A

© education.makeblock.com
10

You might also like