I've always been blitting to the backbuffer but now I blitted a sprite to a background picture and moved the sprite around but of course got that trail that the sprites leaves behind. You would normally use the .cls method, but how can I do this in Direct Draw?
Hmm, I still can't get it to work. Here is my project, maybe someone can take a look please? The right and left keys move the background, the up and down keys move the sprite. So the sprites leaves it's trail and I would like to get rid of that. I know I can blit the sprite to the backbuffer but I don't want that because it won't move with the background.
Whew! There's some pretty big problems there. Here's at least a partial fix. One tip - don't use a textbox for calculating framerate, use a variable. Another tip - use standard formatting for your code. It's very difficult to read as you have it.
Thanks for the tips, but I think I didn't explain too clearly what I want. You know the part where it says:
ddrval = backbuffer.BltFast(sx, sy, You, Ryou, DDBLTFAST_SRCCOLORKEY Or DDBLTFAST_WAIT)
that's blitting the sprite to the "backbuffer", wheres I need it to be blitted to the "Background" like this:
ddrval = Mainsurf.BltFast(sx, sy, You, Ryou, DDBLTFAST_SRCCOLORKEY Or DDBLTFAST_WAIT)
because I need the sprite to be "attached" to the background to move with it and at the same time to be able to move up and down without leaving that trial behind. Any ideas? Hope this explains a bit better
You should almost never blit to the primary surface, if that's what you're doing. I don't remember your code. You should keep track of the sprites position with variables and then blit it wherever it should be.