A Teacher’s Guide to Scratch: Lesson 6

July 28, 2015 by wendy

Scratch Messaging Project
Gobo is getting what he wished for! by pugs22 on Scratch

At this point, your students might be asking, “How can one sprite tell another sprite to do something?” Let’s find out!

Lesson 6: Knock, Knock

Give some examples of features that your students might want to have in their design projects. Maybe they want a sprite to appear or disappear when another sprite says something. We can do this!

Real-life scripts

Script 1 without timing or messaging
Script for your first volunteer

Script 2 without timing or messaging
Script for your second volunteer

Start with some role-playing. In Scratch, show the script that’s above on the left to your students. Ask for a volunteer to perform the script. Reveal the script for another sprite that’s on the right. Ask for another volunteer, and have both volunteers perform the scripts at the same time. What’s the problem? Our sprites talk over each other! We need to coordinate them, but how?

Timing using wait blocks

Script 1 with timing
First script with timing

Script 2 with timing
Second script with timing

We can tell sprites to wait for each other by using wait blocks. How can we use wait blocks to fix our problem? Work as a class to come up with a solution and have your performers test it. Your solution should look like the scripts above.

Messaging using broadcast and receive blocks

Script 1 with messaging
First script with messaging

Script 2 with messaging
Second script with messaging

Wait blocks worked in this scenario because we knew how long to wait, but what if we didn’t know how long to wait? Is there another way?

Introduce broadcast and receive blocks. In Scratch, sprites can send invisible messages like radio signals to other sprites. Other sprites can choose to do something when they receive certain messages.

Revisit your solution with the wait blocks, and as a group, try to replace them with broadcast and receive blocks. Your solution should look like the scripts above. Run your scripts to make sure they work.

Lightning round

Give your students 10 minutes to create a joke project. They can remix an existing project or start a brand new one. At the end of 10 minutes, ask 5 volunteers to share their jokes with the class.

Project time

For the remainder of the class, students can continue to work on their design projects. Encourage them to incorporate timing or messaging into their designs!

Python for Kids (and Adults!)

July 20, 2015 by wendy

Python for Kids
Python for Kids by Garrett Heath is licensed under CC by 2.0

Whether you’re looking for a coding project for your child or yourself, Python might be right for you! This week, we’re taking another break from our Teacher’s Guide to Scratch to give you some tips on how to get started with Python.

Why learn Python?

If your child has already mastered drag-and-drop programming, like Scratch or Hopscotch, then Python is the perfect next step. If you’re a grown-up and you want to learn how to program, then Python is also the perfect place to start.

Programmers love Python because it’s easy to read and write. You write less code in Python than in other languages because it has fewer symbols and its rules are less strict. In other words, Python is easier to learn!

How to learn Python

A book can be a good place to start. Python for Kids: A Playful Introduction to Programming explains key programming concepts and has lots of examples. I started reading this book and liked the step-by-step instructions on how to get started, but for me, it eventually covered too much information for a beginner when I just wanted to play.

Luckily, in Chapter 4, it introduced Turtle, a Python module that allows you to draw on the screen. Turtle was actually part of the original Logo programming language back in the 1960s!

Installing Python

IDLE Python Shell

Before you start coding, you’ll need to install Python. Visit the Python website to download the latest version and run the installer. Once Python is installed, look for IDLE on your computer and run it. IDLE is where you’ll write and run your Python programs.

Drawing with Turtle

Python Drawing Square

Within the IDLE Python Shell, enter the following lines of code to load the Turtle module and to create your turtle. I’m calling my turtle Frank, but you can choose any name you like.

>>> import turtle
>>> frank = turtle.Turtle()

Hopefully, a new window popped up called Python Turtle Graphics with a small triangle in the centre. That’s your turtle! Enter these commands to draw a square:

>>> frank.forward(100)
>>> frank.left(90)
>>> frank.forward(100)
>>> frank.left(90)
>>> frank.forward(100)
>>> frank.left(90)
>>> frank.forward(100)
>>> frank.left(90)

Change the values or parameters inside the parentheses to see what they do. For more commands or functions, check out the Turtle documentation on the Python website. In the meantime, experiment with these:

>>> frank.backward(100)
>>> frank.right(90)
>>> frank.reset()
>>> frank.clear()
>>> frank.up()
>>> frank.down()
>>> frank.pencolor("red")
>>> frank.pensize(5)
>>> frank.circle(100)

Saving your work

Rather than writing your programs in the Python Shell, you can go to File, and click on New File, which will open a new window. When you write your program in the new window, you can save your program and run it by selecting Run and Run Module.

Taking next steps

Python Drawing Using Loops

As you become more comfortable with Python and Turtle, incorporate other programming concepts, like loops, to draw more complex designs. Look for examples online, try them out, make them your own, and have fun!

A Teacher’s Guide to Scratch: Lesson 5

July 13, 2015 by wendy

Scratch Design Project
Reduce Reuse Recycle by pugs22 on Scratch

Congratulations! You’re halfway through our Coding for Kids program! We’ve learned how to sequence instructions to build complex behaviours, how to use events to make interactive programs, and how to use loops to create animations and music. In this lesson, students have the chance to design their own projects.

Lesson 5: Design Project

An open-ended design project is an opportunity for students to not only develop greater fluency in concepts such as events and loops, but also design a project that’s relevant and meaningful to them. What topics are your students most interested in? What types of projects would they like to make?

Project Overview

Explain to your students that today, they’ll be coming up with their own Scratch projects. They can choose to work individually or in pairs. They’ll continue to work on their projects over the next few lessons. Then on the last day, they’ll present their projects to the class!

Today, their job is to brainstorm, come up with an idea, make a plan, and to gather feedback. If they finish early, they can start working on their projects.

Getting started

Remind your students by reviewing past projects that they’ve learned a lot. Now that it’s their turn to design a project, what will they create? Start a discussion with your students about topics that interest them and the types of projects that they would like to make.

Give them the option to build on an existing project or to create a brand new one. Also remind them that it’s okay if there’s a part of the project that they don’t know how to make yet. We’ll still be learning new concepts over the next few lessons, and they can also research on their own!

Making a plan

Give your students time to explore and brainstorm. Perhaps they can add projects that inspire them into their own Scratch studios. Encourage them to sketch their ideas, and to write down any questions and how they might find the answers.

Gathering feedback

Once your students are ready, ask them to share their project plans with other students and to gather at least 3 suggestions. If there’s time remaining, students can start working on their projects, and at the end of class, ask for a few volunteers to share their progress.

A Teacher’s Guide to Scratch: Lesson 4

July 6, 2015 by wendy

Scratch Dance Party
joe’s party by coderlover360 on Scratch

We continue to explore loops, music, and animation by building dance parties with our favourite songs!

Lesson 4: Dance Party

Last week, we played with repeat loops to animate sprites and make music. How are repeat loops helpful? This week, we’re experimenting with another type of loop called the forever loop. Can your students guess what a forever loop is for?

Dance, Dance, Dance

Start the lesson by looking at some dance party examples like the ones above. How did each sprite have so many different looks? In Scratch, we need costumes!

Costumes in Scratch

Create a new project and make sure that Scratch Cat is selected. Click on the Costumes tab next to the Scripts tab. Notice that even Scratch Cat has two different poses or costumes: costume1 looks like Scratch Cat is walking and costume2 looks like Scratch Cat is running. If you click between the two, Scratch Cat starts to animate, but how do we animate using code?

Making sprites dance!

Making Sprites Dance
Animating sprites using forever blocks and costume blocks

By combining forever blocks with costume blocks, we can make sprites dance. Choose a sprite with multiple costumes, and then demonstrate different ways to animate the sprite:

  • Drag the “next costume” block and “wait 1 secs” block into a forever block.
  • Snap a series of “switch costume to…” and “wait 1 secs” blocks inside a forever block.

Don’t forget to show students that they can also paint new costumes to create their own animations.

Adding a favourite song

Ask your students to think of a favourite song to add to their dance party. Follow these steps to add a song from a YouTube video into a Scratch project:

  1. Go to YouTube and choose a video.
  2. Copy the URL.
  3. Go to youtube-mp3.org.
  4. Paste the URL into the box.
  5. Click on Convert Video.
  6. Click on Download.
  7. Go to your Scratch project.
  8. Click on the Sounds tab.
  9. Click on the “Upload sound from file” icon.
  10. Select your downloaded song file.
  11. Click on the Scripts tab.
  12. Click on Sound.
  13. Click the arrow on the “play sound … until done” block to choose your song.
  14. Drag the “play sound … until done” block into a forever block.

Building a dance party

Give students time to find their favourite song and to explore different dance parties. Here are a couple of places to start: Dance, Dance, Dance Studio and Scratch Day Dance Party.

They can also watch the Make your sprite dance video or try the Dance, Dance, Dance tutorial by clicking on “Tips” in the Scratch editor.

Encourage students to create their own project or to remix an existing project. Challenge them to animate the backdrop. Have your students add their dance parties to the class studio and gather feedback from at least three other students.