mar77a
public cpp v1 · immutablevoid Dot::handle_input(){ //Get the keystates Uint8 *keystate = SDL_GetKeyState( NULL ); //If a key was pressed if( event.type == SDL_KEYDOWN ) { //Adjust the velocity switch( event.key.keysym.sym ) { case SDLK_UP: yVel -= yAcc; break; case SDLK_DOWN: yVel += yAcc; break; case SDLK_LEFT: xVel -= xAcc; break; case SDLK_RIGHT: xVel += xAcc; break; } } }