Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 1 Hello, Stinky Head > Getting User Input

Getting User Input

A computer program—including a video game—must do three things, and always only three things. We’ll call them the three rules of programming:

1. Get input.

2. Think about it.

3. Print output.

Even a video game works by following these three important rules. The thing is, a video game doesn’t have to print with a string or message. That item #3 can be changed to mean “Draw output.” The important thing is, something comes out of the program. In a video game, we will want to draw shapes, like players, monsters, trees, houses, and things like that.

Can you think of what the input for a video game might be for step #1?

I’ll let you think about it for a minute….

Ready with your answer?

Okay, I’m sure you got it right, but just to check, the answer is: input from a keyboard, mouse, or a controller.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial