Hope things are all good & the game is progressing....been away working on my game & have come across a problem. I am using SDL, and am trying to make my little sprite man jump correctly.....it seems that although the man jumps up when the 'up' button is pressed down, he does not move to the right/left during the jump until the key is lifted....as you can imagine it makes him move only 1 pixel each time!!
I'd really appreciate any help - the code is listed below (you guys will prob. laugh)
while(char_jump==1)
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
if (event.key.keysym.sym == SDLK_UP)
{
velocity=-15;
jumping=1;
while(jumping==1)
{
velocity=velocity+accel;
walkright.mY=walkright.mY+velocity;
while(SDL_PollEvent(&event))
{
if((event.type == SDL_KEYUP) && (event.key.keysym.sym == SDLK_LEFT))
{DrawWalkLeft();}
if((event.type == SDL_KEYUP) && (event.key.keysym.sym == SDLK_RIGHT))
{walkright.xadd(1);}
}
if (structure[walkright.mX+8][walkright.mY+24]==1)
{
velocity=0;
jumping=0;
char_jump=0;
DrawScene();
}
after that it's really just closing the } and drawsceneing it.
cheers & thanks in advance!
Neil












