more efficient spawns

This commit is contained in:
evanpelle
2024-08-30 11:48:07 -07:00
parent a3156bd50c
commit 64265b1a75
4 changed files with 38 additions and 47 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ export function manhattanDist(c1: Cell, c2: Cell): number {
return Math.abs(c1.x - c2.x) + Math.abs(c1.y - c2.y);
}
export function manhattenDistWrapped(c1: Cell, c2: Cell, width: number): number {
export function manhattanDistWrapped(c1: Cell, c2: Cell, width: number): number {
// Calculate x distance
let dx = Math.abs(c1.x - c2.x);
// Check if wrapping around the x-axis is shorter