- if(keystate[SDLK_LEFT] || keystate[SDLK_h]) { ship.dx -= THRUSTER_STRENGTH*t_frame; ship.jets |= 1<<0;}
- if(keystate[SDLK_DOWN] || keystate[SDLK_t]) { ship.dy += THRUSTER_STRENGTH*t_frame; ship.jets |= 1<<1;}
- if(keystate[SDLK_RIGHT] || keystate[SDLK_n]) { ship.dx += THRUSTER_STRENGTH*t_frame; ship.jets |= 1<<2;}
- if(keystate[SDLK_UP] || keystate[SDLK_c]) { ship.dy -= THRUSTER_STRENGTH*t_frame; ship.jets |= 1<<3;}
- if(keystate[SDLK_3]) { SDL_SaveBMP(surf_screen, "snapshot.bmp"); }
- }
-
- if(keystate[SDLK_p] | keystate[SDLK_s]) {
- if(!pausedown) {
- paused = !paused;
- pausedown = 1;
- if(!paused) ms_end = SDL_GetTicks();
+ if(keystate[SDLK_LEFT] || keystate[SDLK_KP4]) {
+ ship.dx -= THRUSTER_STRENGTH*t_frame; ship.jets |= 1<<0;
+ }
+ if(keystate[SDLK_DOWN] || keystate[SDLK_KP5] || keystate[SDLK_KP2]) {
+ ship.dy += THRUSTER_STRENGTH*t_frame; ship.jets |= 1<<1;
+ }
+ if(keystate[SDLK_RIGHT] || keystate[SDLK_KP6]) {
+ ship.dx += THRUSTER_STRENGTH*t_frame; ship.jets |= 1<<2;
+ }
+ if(keystate[SDLK_UP] || keystate[SDLK_KP8]) {
+ ship.dy -= THRUSTER_STRENGTH*t_frame; ship.jets |= 1<<3;
+ }
+ if(ship.jets) {
+ ship.dx = fconstrain2(ship.dx, -50, 50);
+ ship.dy = fconstrain2(ship.dy, -50, 50);