[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

LINE 20:
FORS1=12288 TO 12350 We are going to use ONE SPRITE (sprite 0) in this animation, but we are going to use THREE sets of sprite data to define three separate shapes. To get our animation, we will switch the POINTERS for sprite 0 to the three places in memory where we have stored the data which defines our three different shapes. The same sprite will be redefined rapidly over and over again as 3 different shapes to produce the dancing mouse animation. You can define dozens of sprite shapes in DATA STATEMENTS, and rotate those shapes through one or more sprites. So you see, you don't have to limit one sprite to one shape or vice-versa. One sprite can have many different shapes, simply by changing the POINTER SETTING FOR THAT SPRITE to different places in memory where the sprite data for different shapes is stored. This line means we have put the DATA for "sprite shape 1" at memory locations 12288 to 12350.
READ Q1 Reads 63 numbers in order from the DATA statements which begin at line 100. Q1 is an arbitrary variable name. It could just as easily be A, Z1 or another numeric variable.
POKES1,Q1 Pokes the first number from the DATA statements (the first "Q1" is 30) into the first memory location (the first memory location is 12288). This is the same as POKE12288,30.
NEXT This tells the computer to look BETWEEN the FOR and NEXT parts of the loop and perform those in-between commands (READQ1 and POKES1,Q1 using the NEXT numbers in order). In other words, the NEXT statement makes the computer READ the NEXT Q1 from the DATA STATEMENTS, which is 0, and also increments S1 by 1 to the next value, which is 12289. The result is POKE12289,0... the NEXT command makes the loop keep going back until the last values in the series, which are POKE 12350,0.


[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated December 10, 2002.