Smooth Animation Problem

Hi Guys,

Can somebody help me with this ?

Am doing a simple car race game using SDL in Linux.

Well the problem is in my animation loop the car image
is leaving traces even though am updating the screen
using SDL_BlitSurface() in the game loop :frowning:

Wat can b the possible problem ?

Thnx in advance.
Visu________________________________________________________________________
Yahoo! India Matrimony: Find your partner online.
Go to http://yahoo.shaadi.com

Vishwanath V wrote:

Well the problem is in my animation loop the car image
is leaving traces even though am updating the screen
using SDL_BlitSurface() in the game loop :frowning:

You forget to clear the surface each frame? You might use SDL_FillRect()
for this purpose.

Regards,
\Mikkel Gjoel

Are you updating the whole screen, or just the area where the car was
the last frame? If the latter, there are two things you must keep in
mind:
1) Remove the car using the old coordinates; ie the
ones you had before you recalculate the car position.

2) If you're using a double buffered display (that is, a
   "real" one, with SDL_HWSURFACE and h/w pageflipping),
   you need to keep track of the last *two* frames; not
   just the last frame.

If that ain’t it, did you accedintally use colorkeying or alpha for
the background? That would prevent blitting that surface to the
screen from removing stuff in areas where the surface is transparent
or translucent…

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Tuesday 21 October 2003 15.15, Vishwanath V wrote:

Hi Guys,

Can somebody help me with this ?

Am doing a simple car race game using SDL in Linux.

Well the problem is in my animation loop the car image
is leaving traces even though am updating the screen
using SDL_BlitSurface() in the game loop :frowning:

Wat can b the possible problem ?