add guarding mechanic and implement guard sprite handling

This commit is contained in:
2025-12-13 23:55:47 +01:00
parent 133afa9c06
commit d018ed3e6e
4 changed files with 64 additions and 12 deletions

View File

@@ -5,6 +5,14 @@ public enum Direction {
UP,
DOWN,
LEFT,
RIGHT
RIGHT;
}
public Direction getOpposite() {
return switch (this) {
case UP -> DOWN;
case DOWN -> UP;
case LEFT -> RIGHT;
case RIGHT -> LEFT;
};
}
}