add arrow support to 2048

This commit is contained in:
2026-10-10 14:02:50 +02:00
parent 0dafe93b51
commit f367ef48a8
+4
View File
@@ -284,18 +284,22 @@ client_poll_event(void)
game_state->is_running = false; game_state->is_running = false;
break; break;
case SDLK_W: case SDLK_W:
case SDLK_UP:
if (game_status == GAME_PLAYING) if (game_status == GAME_PLAYING)
slide(UP); slide(UP);
break; break;
case SDLK_S: case SDLK_S:
case SDLK_DOWN:
if (game_status == GAME_PLAYING) if (game_status == GAME_PLAYING)
slide(DOWN); slide(DOWN);
break; break;
case SDLK_A: case SDLK_A:
case SDLK_LEFT:
if (game_status == GAME_PLAYING) if (game_status == GAME_PLAYING)
slide(LEFT); slide(LEFT);
break; break;
case SDLK_D: case SDLK_D:
case SDLK_RIGHT:
if (game_status == GAME_PLAYING) if (game_status == GAME_PLAYING)
slide(RIGHT); slide(RIGHT);
break; break;