Commodore 64 User Manual page 84

Hide thumbs Also See for 64:
Table of Contents

Advertisement

of X change in line 30 from 0 to 200 (one number at a time) the sprite
moves across the screen DOWN and TO THE RIGHT one space for each
number. The numbers are READ by the computer fast enough to make
the movement appear to be continuous, instead of 1 step at a time. If
you need more details take a look at the register map in Appendix O.
When you get into moving multiple objects, it would be impossible for
one memory section to update the locations of all eight objects. There-
fore each sprite has its own set of 2 memory sections to make it move on
the screen.
Line 70 starts the cycle over again, after one pass on the screen. The
remainder of the program is the data for the balloon. Sure looks differ-
ent on the screen, doesn't it?
Now, try adding the following line:
25 POKE V+23,4 : POKE V+29,4: REM EXPAND
and RUN the program again. The balloon has expanded to twice the
original size ! What we did was simple. By POKEing 4 (again to indicate
sprite 2 ) into memory sections 23 and 29 , sprite 2 was expanded in the
X and Y direction.
It's important to note that the sprite will start in the upper left-hand
corner of the object. When expanding an object in either direction, the
starting point remains the same.
For some added excitement , make the following changes:
11 POKE V+21,12
12 POKE 2042 , 13 : POKE 2043,13
30 FOR X = 1 to 190
45 POKE V+6,X
55 POKE V + 7,190-X
A second sprite ( number 3 ) has been turned on by POKEing 12 into the
memory location that makes the sprite appear (V+21). The 12 turns
sprites 3 and 2 on (00001100 = 12).
The added lines 45 and 55 move sprite 3 around by POKEing values
into sprite 3's X and Y coordinate locations (V+6 and V+7).
Want to fill the sky with even more action ? Try making these addi-
tions:
28 IS REALLY 4 (SPRITE 2) + 8
(SPRITE 3) + 16 (SPRITE 4)
11 POKE V+21,28-
12 POKE 2042,13:POKE 2043,13:POKE 2044,13
25 POKE V+23,12 : POKE V+29,12
48 POKE V+8,X
58 POKE V+9,100
P
D
5
74

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents