Belle again with another SDL question.
Recently, I finally got all of my basic set-ups involved in one 2D game.
This took a lot fo effort and great amounts of trial-and-error.
While reaching this goal, I figured I could move on to a bit different stradegy...
Moving images.
Is this right? Because this doesn't work:
void draw_sprite(int srcX, int srcY,
int dstX, int dstY,
int width, int height,
SDL_Surface* source, SDL_Surface* destination) {
SDL_Rect src;
src.x = srcX;
src.y = srcY;
src.w = width;
src.h = height;
SDL_Rect dst;
dst.x = dstX;
dst.y = dstY;
dst.w = width;
dst.h = height;
if (player_ismoving && player_pos == 2) { //player_ismoving detects when the player is moving
dstX -=1; //player_pos == 2 means if the player is facing right
}
SDL_BlitSurface(source, &src, destination, &dst);
}
SO why doesn't this work?
How can I fix it?
Thanks guys!
Belle (Anonymous Idon User)

New Topic/Question
Reply



MultiQuote





|