O'Reilly logo

Learn to Program with Phrogram™!: A Guide to Learning Through Game Programming Using the Latest Version of Kids Programming Language by David Witus, Walt Morrison, Jon Schwartz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Section 5Keyboard Control of Your UFO

Key Press Detection 62Using a While Loop to Run Your Game 62Moving the UFO When Keys Are Pressed 63Exercise: Turbocharge Your UFO 65

The example in this section is much easier than the last one, and we're sure you'll find it more fun, too: You get to control the movement of your UFO yourself by pressing keys on the keyboard! Let's start with all of the program instructions:

image

image

There are only two new concepts to understand in this program: using a While loop instead of a For loop, and detecting keys that the user ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required