heres what I have so far
SDL_PollEvent(&keyboard_event);
{
if ( keyboard_event.type == SDL_KEYDOWN )
{
switch ( keyboard_event.key.keysym.sym )
{
case SDLK_LEFT:
launcher.SetVelocityX(-MOVE_SPEED);
break;
case SDLK_RIGHT:
launcher.SetVelocityX(MOVE_SPEED);
break;
}
last_key = keyboard_event.key.keysym.sym;
return;
}
else
if ( keyboard_event.type == SDL_KEYUP )
{
switch ( keyboard_event.key.keysym.sym )
{
case SDLK_LEFT:
launcher.SetVelocityX(0);
break;
case SDLK_RIGHT:
launcher.SetVelocityX(0);
break;
}
return;
}
}
whenever I switch keys my object stops moving for a couple of seconds , then it resumes movement