HALTED: major overhaul for character
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user