déplacement sur blanc corrects

This commit is contained in:
alberr_b0yyy 2025-06-12 13:21:22 +02:00
parent 36b962ece1
commit 6cb6b2f71a

6
main.c
View File

@ -159,7 +159,7 @@ int controls() {
}
break;
case 106: // j
if (y < 7 && (piece_color[y][x - 1] == 1 || piece_color[y][x - 1] == 2)) {
if (y < 7 && (piece_color[y + 1][x] == 1 || piece_color[y + 1][x] == 2)) {
y++;
y_direction++;
piece_selection();
@ -171,7 +171,7 @@ int controls() {
}
break;
case 107: // k
if (y > 6 && (piece_color[y][x - 1] == 1 || piece_color[y][x - 1] == 2)) {
if (y > 6 && (piece_color[y - 1][x] == 1 || piece_color[y - 1][x] == 2)) {
y--;
y_direction = -1;
piece_selection();
@ -183,7 +183,7 @@ int controls() {
}
break;
case 108: // l
if (x < 7 && (piece_color[y][x - 1] == 1 || piece_color[y][x - 1] == 2)) {
if (x < 7 && (piece_color[y][x + 1] == 1 || piece_color[y][x + 1] == 2)) {
x++;
x_direction++;
piece_selection();