déplacement sur blanc corrects
This commit is contained in:
parent
36b962ece1
commit
6cb6b2f71a
6
main.c
6
main.c
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user