Page 1 of 1

PostPosted: Fri Dec 09, 2005 9:34 am
by Mikael
I've modified the sprite.c example program and am having a problem with the SpriteRectColl() function. I'm currently testing with two sprites, each with their own movement handlers, and have it set so that when a small sprite is hit by a big sprite, the small sprite disappears; which it indeed does after the lines:

if(j!=-1) {
data[0].cmd = 4;//Turn sprite off and hide it

The problem is that after the small sprite disappears, the large sprite speeds up and all the buffering stops - it doesn't redraw and just leaves trails behind it. Am I doing something wrong?

Thanks in advance,


PostPosted: Sat Dec 10, 2005 3:11 am
by jstadolnik
Yeah, you found a bug in my code (the streaking effect). If you want the fix send me an email.

The 2 sprites speed up when the 3rd is turned off, because the processor only has to handle the computations for 2 sprites rather than 3. There isn't any code here to add delays to keep the frame rate a constant time. Pretty much all arcade style game which run on platforms of varying speed, need to add such delays to keep the frame rate steady.


The PToolboxLib guy.