9
A Maze Game
In Project 5, you stamped shapes based on your mouse’s position, and in Project 7, you created a simple sketch to display typed text. Both projects relied on user input, and for the next few chapters, we’ll explore more input options, organized by the types of peripherals you can use with your computer and their level of difficulty.
You met event functions in Project 8, but so far, you’ve used only the mouse. In this chapter, you’ll tackle the keyboard! First, I’ll introduce you to a new keyboard variable as well as some keyboard event functions. Once we’ve covered the basics, you’ll write a maze game that players can navigate with the arrow keys. You’ll use your knowledge of if() statements, image processing, and incrementing and ...
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