feat: App-Gerüst mit Spieler auf Testfläche

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
knsoandClaude Sonnet 5 committed 2026-09-12 13:28:09 +02:00
1 parent a523dce676
commit b27b9b7a61
10 files changed
+3630

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import { describe, expect, it } from "vitest";
import { CHUNK_SIZE, chunkForWorld, threeToWorld, tileForWorld, worldToThree } from "../src/world/coords.js";
describe("coords", () => {
it("dreht Y zur three-z-Achse", () => {
expect(worldToThree(1699, 743)).toEqual({ x: 1699, z: -743 });
expect(threeToWorld(1699, -743)).toEqual({ X: 1699, Y: 743 });
});
it("findet die Kachel von Vice Beach", () => {
expect(tileForWorld(1409.4, 2803.2)).toEqual({ row: 53, col: 69 });
});
it("deckt den Ausschnitt mit Spalten 60..71 und Zeilen 54..65 ab", () => {
expect(tileForWorld(-1000, 2500)).toEqual({ row: 54, col: 60 });
expect(tileForWorld(1999, -499)).toEqual({ row: 65, col: 71 });
});
it("teilt den Ausschnitt in 250-m-Chunks", () => {
expect(CHUNK_SIZE).toBe(250);
expect(chunkForWorld(-1000, 2500)).toEqual({ i: 0, j: 0 });
expect(chunkForWorld(1999, -499)).toEqual({ i: 11, j: 11 });
});
});