Section 4Bouncing Your UFO Around the Screen

How to Know the Size of the Screen 47Moving Your UFO on the Screen 49Keeping the UFO in the Box 52Exercise: Peekaboo UFO 58

Here is where our program starts getting larger and more complex—but it is also going to do much more! This program, when you run it, will make your UFO "bounce" around the screen for 15 seconds, as though the window is a box from which the UFO cannot escape. First we'll show you all the instructions, and then we'll explain the new things happening in the program. Remember that if you don't want to type all this new code, you can go to the Phrogram Web site and look for the discussion forum for this short cut. You can copy or download all the examples in the short cut from there. ...

Get Learn to Program with Phrogram™!: A Guide to Learning Through Game Programming Using the Latest Version of Kids Programming Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.