I see people have already chimed in to make sure you’re repainting your
background correctly, but more specifically, if you’re only repainting
the portion of the background that lies underneath the sprite, remember
to repaint the background using the co-ordinates from the last frame.
i.e.
Repaint background
Update sprite co-ordinates
Redraw sprite
If you’re doing something like:
Update sprite co-ordinates
Repaint background
Redraw sprite
Then you’ll have trouble. The suggestion to move the sprite by
increments larger than 1 pixel, say at least 50 pixels, is a very good
one.
— Adam Clauss wrote: > I’m new to SDL and
have been working through the tutorials on:
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/index>
I have a basic app with a background and a single sprite that I can
move
around w/ the arrow keys. However, for some reason it is leaving a
’streak’
behind it - as in the, the background is repainted correctly, but the
background is BRIGHTER than it was initially.
For the background, I am loading a bmp and then tiling that bmp onto
another
surface (creating using SDL_CreateRGBSurface) to create the full size
background.
For an example, look here:
http://cabadam.homeip.net/streak.html
Adam Clauss
cabadam at houston.rr.com
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
=====
Paul Smith
Postgraduate Student
Department of Mathematics, Engineering
and Computer Science
University of Exeter
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk