core: add Snake using Typescript #7

Merged
Trianta merged 35 commits from snake into main 2024-11-09 01:26:09 -06:00
Showing only changes of commit 3699ed465b - Show all commits

View File

@ -214,7 +214,6 @@ class Bot {
continue;
if (isBitSet(g_snake.board[location.y][location.x], BoardState.SNAKE)) {
reachedSnake = true;
this.path.push(location);
continue;
}
var delta = new Point;
@ -241,7 +240,7 @@ class Bot {
*/
nextMove() {
// Get new path to food
if (this.path.length === 1)
if (this.path.length === 0)
this.pathRefresh();
var next: Point = new Point;
next.copy(this.path.pop());