HALTED: major overhaul for character

This commit is contained in:
2024-07-13 22:05:17 -04:00
parent 39d3447593
commit f0aa564e08
10 changed files with 298 additions and 172 deletions

View File

@ -84,3 +84,8 @@ float distance(const position &a, const position &b) {
int distance_sqr(const position &a, const position &b) {
return pow(a.x - b.x, 2) + pow(a.y - b.y, 2);
}
bool is_adjacent(const position &a, const position &b) {
return (a.x - b.x >= -1 && a.x - b.x <= 1) &&
(a.y - b.y >= -1 && a.y - b.y <= 1);
}