Write_your_own_Program_Moving_Graphics_Alien_Invaders.pdf

(8434 KB) Pobierz
First published
In
Great Bntain in 1985 by
Franklin Watts
12a Golden Square
London
WI
First published in the
United States in 1985 by
'"
~
4
Gloucester Press
Copyright
©
Aladdin Books Ltd 1985
Printed in Belgium
ISBN 0 53103491 7
Library of Congress
Catalog Card Number: 84-73147
..
-;
1
.
.
.
,;.
WRITE YOUR OWN
PROGRAM_~
.
.
"
'Or
.
'
Marcus Milton
'------_ _ _ _
GLOUCESTER PRESS
.
.
NEW YORK· TORONTO' 1985
- - - - - - - . . - . I
Foreword
If
you have
a
computer, then
you
are almost
certam
to have
played a Space
Invaders
game of
one kmd
or another.
In thIS
book, you'll find a program that allows you to create an
"invaders" game of your own,
m full
color.
The
program
is
given
for the Apple lIe
and Commodore 64 computers
An mvaders game relles upon
moving
graphIcs
to be
effective.
The
pnnclple
is
simIlar
to those used
m cartoons-
old
characters
are erased from the screen
before
bemg
printed in a
new POSItIon,
giving
the impression
of
movement.
The program has been broken down to ItS
logIcal
stages, and
there IS
a
runmng
text
WhIch
explains
how
each
section
works. You
w
ill find
,
for
example,
just how
It
IS that the computer "knows" when an invader
has been
shot
by one
of your mIssiles. Wnting a program
m thIS
way
not
only
makes It easier for
you
and other
people
to
understand,
it
also makes
it
run more qUIckly
and
reduces
the
possibIlity of errors.
At
vanous stages you
can
test
the
sections of program
that
you've keyed
in -
even
the
smallest
error can
mean that the
program doesn't
work.
If
something
does
go wrong
check
back through the llstmg very carefully
Looking for "bugs" in
a program
IS llke playing
a detectIve
game - the
clues
are there for you to spot them
Contents
Introducing animation
The flowchart
-------
8
-------
User defined characters
----------
10
12
1
THE CONTROL PROGRAM AND INITIALIZATION
APPLE lIe
COMMODORE 64
13
14
18
23
24
28
.
2
MOVING
lUtD
FIRING
APPLE lie
.y,
COMMODQJE
64
3
WINNING AND
LOSING
APPLE lIe
-
33
34
36
-
COMMODORE 64
The complete listing
~
Glossary
Index
.
Zgłoś jeśli naruszono regulamin