in SDL can a simple sprite just be a bmp loaded onto a surface? or is there a function for loading sprites?
in SDL can a simple sprite just be a bmp loaded onto a surface? or is there a function for loading sprites?
The Free Online Dictionary of Computing States:
sprite - A small bitmap image, often used in
animated games.
Therefore, what do you think a sprite is? It is a simple BMP loaded onto a surface.
Now, some sprites consist of more than one frame of animation. Most of the time those sprites will have all of their animation frames in one BMP file. In that case you simply load the entire BMP onto a surface, and you use a source rect to specify what frame gets blitted.
The destination rect specifies where the sprite gets blitted onto the screen (or other surface).
ah ofcourse.
thanks a lot
ok ive got my .bmp which hold two different images. 2 x (128x29)
ive got this
but im not sure how i go about alternating between the two blocks at a reasonable speed.Code://updates background DrawIMG(back, xpos-speed, ypos-speed, 128+(speed*2), 29+(speed*2), xpos-2, ypos-2); // draws block blurred DrawIMG(image, xpos, ypos, 128, 29, 0, 0); // draws block normal DrawIMG(image, xpos, ypos, 128, 29, 129, 0); SDL_Flip(screen);
[edit] now i got this but it doesnt wor the way i hoped.
i know its prbably going so fast that you cant tell its doing anything but what is a good way around it?[/edit]Code:if (blur = true) { // draws block blurred DrawIMG(image, xpos, ypos, 128, 29, 0, 0); blur = false; } else { // draws block normal DrawIMG(image, xpos, ypos, 128, 29, 129, 0); } SDL_Flip(screen);
Last edited by sand_man; 07-02-2004 at 12:11 AM.