1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 08:26:44 +02:00

Some minor fixes for game module

This commit is contained in:
jfreegman
2021-06-28 13:54:25 -04:00
parent 321f694bb8
commit 8dfd009e0e
10 changed files with 80 additions and 49 deletions

View File

@ -104,22 +104,28 @@ void game_util_move_coords(Direction direction, Coords *coords)
{
switch (direction) {
case NORTH: {
--(coords->y);
if (coords->y > 0) {
--(coords->y);
}
break;
}
case SOUTH: {
++(coords->y);
++(coords->y); // Will rollover if you do something stupid
break;
}
case EAST: {
++(coords->x);
++(coords->x); // Will rollover if you do something stupid
break;
}
case WEST: {
--(coords->x);
if (coords->x > 0) {
--(coords->x);
}
break;
}