Skip to content

Commit

Permalink
Block tail chase heads
Browse files Browse the repository at this point in the history
  • Loading branch information
Petah committed Sep 3, 2020
1 parent a246689 commit e4b3f8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/moveTowardsTail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Pather } from './Pather';

// @todo don't move if near bigger snake
export function moveTowardsTail(data: BTData) {
const pather = new Pather(data, false);
const pather = new Pather(data, true);
const path = pather.pathTo(data.you.body[data.you.body.length - 1].x, data.you.body[data.you.body.length - 1].y);
if (path.length) {
const direction = pather.pathToDirection(path);
Expand All @@ -13,5 +13,5 @@ export function moveTowardsTail(data: BTData) {
return direction;
}
}
log('moveTowardsEnemy', 'no options');
log('moveTowardsTail', 'no options');
}

0 comments on commit e4b3f8d

Please sign in to comment.