Browse Source

Richting oben

main
Siamak 2 years ago
parent
commit
2dcc8d222b
  1. 42
      src/Spiellogik.c

42
src/Spiellogik.c

@ -85,32 +85,36 @@ int update(int realU[N][N],char richtung) {
} }
} }
} }
if(richtung == 'u') {
if(ii == 0) {
return 1;
}
if(realU[ii + 1] [jj] == (N * N) + 1) {
realU[ii + 1] [jj] = groesste + 1;
apple(realU);
speed = speed + 20;
}
else {
if(!lose(realU, richtung)) {
if(richtung == 'u') {
if(ii == 0) {
return 1;
}
if(realU[ii + 1] [jj] == (N * N) + 1) {
realU[ii + 1] [jj] = groesste + 1;
apple(realU);
speed = speed + 20;
}
else {
if(!lose(realU, richtung)) {
realU[ii - 1][jj] = groesste + 1; realU[ii - 1][jj] = groesste + 1;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (realb[i][j] != 0 && realb[i][j] != (N * N) + 1) {
realb[i][j]--;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (realb[i][j] != 0 && realb[i][j] != (N * N) + 1) {
realb[i][j]--;
}
} }
} }
} }
else {
return 1;
}
} }
else {
}
else if (richtung == 'd') {
if (ii == N - 1) {
return 1; return 1;
}
}
} }
}
int probe(int input){ int probe(int input){
return input; return input;

Loading…
Cancel
Save