#### Keyboard
-| Key | Action |
-|---------|-------------------------------------------------------------|
-| `d` | Move to the right |
-| `a` | Move to the left |
-| `SPACE` | Jump |
-| `c` | Open debug console |
-| `r` | Reload the current level including the Player's position |
-| `q` | Reload the current level preserving the Player's position |
-| `p` | Toggle game pause |
-| `l` | Toggle transparency on objects. Useful for debugging levels |
-| `TAB` | Switch to Level Editor |
+| Key | Action |
+|----------|-------------------------------------------------------------|
+| `d` | Move to the right |
+| `a` | Move to the left |
+| `SPACE` | Jump |
+| `c` | Open debug console |
+| `r` | Reload the current level including the Player's position |
+| `q` | Reload the current level preserving the Player's position |
+| `p` | Toggle game pause |
+| `l` | Toggle transparency on objects. Useful for debugging levels |
+| `TAB` | Switch to Level Editor |
+| `CTRL+q` | Quit the game |
#### Gamepad
game->cursor_x = event->motion.x;
game->cursor_y = event->motion.y;
} break;
+
+ case SDL_KEYDOWN: {
+ if (event->key.keysym.sym == SDLK_q && event->key.keysym.mod & KMOD_CTRL) {
+ game_switch_state(game, GAME_STATE_QUIT);
+ return 0;
+ }
+ } break;
}
switch (game->state) {