1 of 22

Introduce Platform

code blocks

workspace

sprites

backdrops

stage

2 of 22

Adventure on the High Seas

3 of 22

Animate the Wave

  1. Click the starter project link in CoeHS
  2. Add a "change whirl effect" block to create the wave effect.
  3. Add a "change whirl effect by -25" to reverse the wave effect.
  4. Place a wait block after each "change effect by" block.
  5. Make the wave keep going with a "forever" block.
  6. Add a "when flag clicked" block to run this code stack when the flag is clicked.

4 of 22

Tell a Story

PLAN

What will your story be about?

Ideas

  • Characters hunting for treasure
  • Got on a boat by accident
  • Disagreement about where they will go

5 of 22

Tell a Story

1. Choose a boat for your story by clicking on the boat sprite in the starter code and selecting your boat in the costumes tab

6 of 22

Tell a Story

2. Choose two sprites to have a conversation.

3. Position them in the boat and have them face each other.

Click the costumes tab and “Flip Horizontal”to change the way sprites face

7 of 22

Tell a Story

5. Add code to the water sprite to make it go the the front.

6. Click the green flag to test.

4. A piece of code has already been added to the boat to make it go to the front but behind the water sprite

8 of 22

Tell a Story

7. Add code to one of the sprites to say the first part of the conversation

8. Add code to the second sprite to respond.

Click in the “Hello” bubble to type your words.

9 of 22

Step-by-Step

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

Both sprites are talking at the same time

10 of 22

Step-by-Step

10. 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 22

Step-by-Step

11. Add the rest of the lines of the story to each sprite using say blocks and wait blocks.

12 of 22

Step-by-Step

Test and Debug - to make sure the story goes in the correct sequence.

13 of 22

Animate the Wave

  1. Select the wave sprite

  • Add code to start the wave

14 of 22

Animate the Wave

3. Click the Flag to test your program

4. Click the stop sign to stop the program

The wave isn’t acting like a normal wave, it needs to move back and forth

15 of 22

Smooth Out Your Wave

  • Add a “repeat” block around each pair of “change effect” and “wait” blocks.
  • Change the values of the blocks to create a smooth wave effect for your program.

16 of 22

Smooth out the Wave

5. Add another whirl effect and change the number to -25

6. Add wait blocks after each effect block so you can see the code run

7. Click the Flag to test your program

8. Click stop.

Let’s fix the wave to go back and forth

17 of 22

Smooth out the Wave

9. Make two new loops to move the wave in smaller increments

To make the make the wave move more smoothly,adjust the effects to change in smaller increments

Tinker with the numbers to create the effect you want

Don’t forget to make this value a negative number

Click the “clear graphic effects” block to reset the wave

18 of 22

Smooth out the Wave

10. Put the two loops inside the forever loop to make a nested loop (loop inside another loop)

11. Click the Flag to test your program

12. Click stop.

19 of 22

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?

20 of 22

Revise

Extensions

Debug

Add comments in your code to explain what it does.

Get feedback from a friend.

Make project more fun

Make it harder or easier to play.

Use a block you’ve never used before.

Add background music.

Does everything work the way you want it to?

Is there anything you want to change?

Make your own custom sprite.

21 of 22

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

22 of 22

Resources

Hide and Seek