Re: A85: Sprite Routines
[Prev][Next][Index][Thread]
Re: A85: Sprite Routines
At 08:27 PM 4/20/98 EDT, you wrote:
>In a message dated 98-04-20 19:37:50 EDT, you write:
>
><< I'm sorry to say that it doesn't support masking. Masking is a new
> technique for sprites (for the 82 anyway) that erases a defined section of
> the screen (where the sprite will be displayed) and then displays the
> sprite. Masking won't work, however, with scrolling buffers, that my
> graphics routines use because all of the screen buffers would have to be
> cleared (wherever the sprite was located), which would make masking slow
> and useless. However, masking becomes useful in a single layer environment
> because there is no background behind the sprite in another buffer. >>
>
>Is masking used to make the sprite appear like it "slides" when you tell
it to
>move, kind of like in Slippy II ?
No. Masking is something like taking an image the size of the sprite
(let's say 8x8 for my example), like so:
SpriteMask:
.db 8, 8
.db %11111111
.db %10000011
.db %00000001
.db %00000001
.db %00000001
.db %10000011
.db %11000111
.db %11111111
The mask is done by clearing only the pixels that have 0's and leaving the
1's. This means that in a game like SQRXZ, the main character will never
be hidden because nothing will be behind the sprite to add pixels. The
sprite for the mask above is seen below:
Sprite:
.db 8, 8
.db %00000000
.db %01111100
.db %10101010
.db %10000010
.db %10010010
.db %01000100
.db %00111000
.db %00000000
Dumb looking face, but it works to demonstrate the usefulness of the mask.
However, as I said before it won't work with multi-buffered screens. SQRXZ
82 would therefore not be able to use this feature as the speed would erode
badly if I did.
Thomas J. Hruska -- thruska@tir.com
Shining Light Productions -- "Meeting the needs of fellow programmers"
http://www.geocities.com/SiliconValley/Heights/8504
http://shinelight.home.ml.org
Follow-Ups:
References: