CHAPTER 3
Inputting and Outputting
Do you like playing with peppy puppies? If so, you’ll love the project in this chapter! The interactive toy you create in this chapter introduces you to your first big idea in coding: sequencing. The code you write executes in sequence: the first command runs, then the next command runs, then the next command runs, and so on, until the last command in the program runs. An event starts the code sequence or triggers an action: in this program, a user inputs a click of the computer mouse or makes a loud sound into the computer microphone. The program responds to the input by doing something — it outputs some sort of result.

In the Peppy Puppy project, you’ll create and code a simple toy with a background and a few sprites, including a dog and letter balloons that spell the dog’s name. You’ll write code so that when the user inputs a click on a letter balloon, the program outputs a balloon pop. You’ll also write code so that when the user inputs a spoken “Good Dog!” (or makes any sound), the program outputs a dog bark. Along the way, you’ll play with sounds and graphics tools to customize your toy. Now you’re coding!
Brainstorm
Brainstorm the design of your program by thinking about the overall look of your toy and what animal you’d like to feature. The end users — the people who will interact with your program — will play with the toy, seeing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access