1 of 14

Two sprites “talk” to each other and tell a knock-knock joke.

Objective: Students will be program 2 sprites using “say” blocks and “wait” blocks. They will be able to adjust the timing and sequence so they take turns speaking.

Expected Outcome

Students will be able to:

  • add two sprites and background
  • code each sprite with say and wait blocks
  • adjust the timing so the sprites take turns speaking

Objectives/Outcome

Dialogue

Prerequisites:

Students should have foundational understanding of:

  • adding sprites

Vocabulary

Sequence

Algorithm

Event

2 of 14

Project Sample

3 of 14

Sequence

Next

First

Then

Last

Steps arranged in a specific order

4 of 14

Connection

What is wrong with the sequence of this program?

When we create code we need to be careful to put the code blocks in the correct sequence.

5 of 14

Create the Code:

Knock Knock Jokes

Dialogue

6 of 14

Dialogue

Decompose

Add Sprite and Background

Time sprite to say a knock-knock joke

What are some of the code blocks I need?

7 of 14

Step-by-Step

3. Add code to one of the sprites to say the first line of the knock knock joke.

8 of 14

Step-by-Step

4. Add code to the second sprite to say the second line of the knock knock joke.

9 of 14

Step-by-Step

5. Click the flag and test the program so far. What is wrong?

Both sprites are talking at the same time

10 of 14

Step-by-Step

6. To make them take turns use a wait block before the second sprite speaks

Adjust the time to wait until the first sprite finishes talking.

11 of 14

Step-by-Step

7. Add the rest of the lines of the joke to each sprite using say blocks and wait blocks.

Test and Debug

12 of 14

Example Code

13 of 14

Revise

Extensions

Debug

Can you add background music?

Can you add a third sprite to laugh when the joke ends?

Can you add motion or actions for your sprite or costume changes?

Can you code a second knock-knock joke?

Does everything work the way you want it to?

Is there anything you want to change?

14 of 14

CS 3AP-3b Create programs that include sequences, events, loops, and conditionals

CS 3AP-4a Break down (deconstruct) algorithms and list the steps needed to solve a problem into a sequence of tasks and sub-tasks.

CS 3AP-5e Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended

Vocabulary

Code Blocks

Skills

CODE BLOCKS

SKILLS

VOCABULARY

STANDARDS

Show

Hide

Point towards

Move

Wait

Go to random

If/then

Sensing operator

Start sound

Conditionals

Random

Algorithm

Event

  • Create an algorithm
  • Make sprite follow mouse pointer
  • Make a sprite appear and disappear in random locations
  • Use conditionals with sensing blocks to control events