Hmm, proabably I’m a still a begginner in C but,
I have been thinking about how to display an image moving
it keeping background updated. (I can do that reBlitting
the whole background image, but FLICKER is bad that way).
Exacatly how can I redraw just the portion of the background
overlayed by the moving Image ? ( DO I have to know the exact
dimension, width and lenght of the image ? )
I’ve tried that way :
while (game_state != 0)
{
int key;
key = get_SDL_keyboard_number();
if (key == 1) SDL_Delay(8), blit_SDL_bmp (background, 0, 0),ypos= ypos+20, blit_SDL_bmp (image, xpos, ypos);
else if (key == 2) SDL_Delay(8),blit_SDL_bmp (background, 0, 0),ypos= ypos-20, blit_SDL_bmp (image, xpos, ypos);
else if (key == 3) SDL_Delay(8),blit_SDL_bmp (background, 0, 0),xpos= xpos+20, blit_SDL_bmp (image, xpos, ypos);
else if (key == 4) SDL_Delay(8),blit_SDL_bmp (background, 0, 0),xpos= xpos-20, blit_SDL_bmp (image, xpos, ypos);
else if (key == 5) game_state = 0;
}
image is the surface of the moving sprite
background is the surface of the image background…
Well, I’m stucked :(–
-
@G.Gabriele ---------------+
| Linux |
±--------------- the free philosophy -+