CHAPTER
Game
Controllers
The
programs
we
have described
so
far have communicated with you
in a "stop and go" fashion; that is, they stopped and waited for you to type
something
at
the keyboard, then acted on it. This
is
fine for balancing a
checkbook or typing letters, but many VIC
20
applications require a differ-
ent style
of
communication. A program that simulated airplane flying
wouldn't be realistic if the plane stopped in midair while the "pilot" typed
instructions. To make this type of program more realistic (and less tedious
to use), the VIC takes its directions from a different source. Instead of
receiving instructions through the keyboard, the VIC can use
game con-
trollers,
the joystick and paddle controllers similar to those used in arcade
games. Since Commodore had not yet released paddle controllers for the
VIC
20
when this book was being written,
our
examples were tested on
paddle controllers manufactured by Atari, Inc., which are compatible with
Commodore joysticks.
In this chapter we'll show you how to write programs that use these
game controllers. We'll also describe how to use the keyboard
"on
the run,"
eliminating the stop and wait steps.
If
you don't have a joystick,
our
keyboard example illustrates how to simulate one.
157