Re: A89: Need help with game
[Prev][Next][Index][Thread]
Re: A89: Need help with game
I think that these are the op codes:
lsl <-logical shift left
lsr <-logical shift right
Also, I would not recommend doing this directly to the sprite itself, but
rather a buffer, because you loose however many bits you specify. Here is
an example:
sprite:
dc.b %11110001 <-notice this line
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
'lsl sprite,4' then results w/ this:
sprite:
dc.b %00011000
dc.b %00011000
dc.b %00011000
dc.b %00011000
dc.b %00011000
dc.b %00011000
dc.b %00011000
dc.b %00010000
Notice, everyline was moved left, and all of the extra was moved to the end
of the line above it, except the first line, which just got rid of the
'extra' bits. Now if we try to restore the modified sprite back to it's
original state (by 'lsr sprite,4), we end up w/ this:
sprite:
dc.b %00000001 <-notice this line
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
You end up losing those first 4 bits.
-Miles Raymond EML: m_rayman@bigfoot.com
ICQ: 13217756 IRC: Killer2 AIM: kilier2
http://www.bigfoot.com/~m_rayman
----- Original Message -----
From: "Scott Dial" <wrath@calc.org>
To: <assembly-89@lists.ticalc.org>
Sent: Tuesday, January 25, 2000 9:19 PM
Subject: Re: A89: Need help with game
> You have to shift the bytes in the sprite so that the sprite that is
> drawn appears to hang over the edge but doesn't. If you hung over the
> edge by 3 pixels then you do a lsl #3 to every row in the sprite; If you
> hung over the right side, shift to the right (rsl).Hanging over the
> bottom and top consists moving the words "up" and "down" in the sprite
> being drawn.
>
> BLoWh0Le@aol.com wrote:
>
> > Hey, I've been contemplating how to tackle this problem for a while now.
My problem is that I have to draw an explosion (a circle really) wherever a
bullet lands in my game. This works fine in the middle of the screen, but
when the bullet lands 16 or fewer pixels from the left side, I cannot use
graphlib to display my explosion sprite.
> >
> > Anyone have any tips?
>
> --
> Scott "_Wrath_" Dial
> wrath@calc.org
> ICQ#3608935
> TimeCity AI Guy II - www.timecity.org
> Member of TCPA - tcpa.calc.org
References: