Sprite() problem

A PocketC native palm library offering native forms and assorted utilities

Postby Mikael on Fri Dec 09, 2005 9:34 am

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,

Posts: 156
Joined: Sun Apr 13, 2003 9:19 am
Location: Denmark

Postby jstadolnik on Sat Dec 10, 2005 3:11 am

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.
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest