11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

INSTRUCTOR NOTES 31 SPRITES ^The VIC chip in the Commodore 64 controls the video displays. In particular, it controls ^jeight sprites, powerful bit-mapped graphics objects (24 bits wide and 21 bits high).This lesson gives the student a program in which the sprite she draws on the screen isPOKEd into memory without the drudgery of determining bit patterns and changing ^them to decimal numbers.The sprite can be colored with one POKE and moved to another spot on the screen with ^jone to three more POKEs. Each sprite is told which picture to display by a "pointer"updated with a single POKE. Many pictures can be stored ahead of time and rapidly Odisplayed one after another by the same sprite. Conversely, several sprites can displaythe same picture in different colors and different spots on the screen at the same time. ^Those portions of a sprite in which the bit is "0" are transparent, showing whateverobjects (other sprites or screen graphics) are behind them. The frontmost sprite of an \^joverlapping pair is the one with the lowest sprite number. For each sprite, the programmercan choose whether it passes in front of or behind objects in the static screen display. ^JEach sprite can be expanded to double size in the horizontal or vertical (or both) ^dimensions. Multicolored sprites can be made (three colors plus background) but this is >,not explained in this book.There are two registers for recording collisions involving sprites. One records if a spritehas collided with any background drawing on the screen. The other records which sprites ^Jhave collided with other sprites. These registers keep a record of the collision, even if thesprites have moved off and are no longer overlapping, until the register is read with a ^PEEK. Then the register is cleared to zero, "no collisions." ^.QUESTIONS:1. How do you tell sprite 0 which picture to show?2. How do you tell sprite 0 to move to the center of the screen? * ^j3. How do you color sprite 1 red? ^J4. How do you tell sprite 2 to grow wider? ^5. What does the "sprite hits sprite?" register contain if sprite 3 and sprite 5are overlapping?^jo176

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!