fable/val Public Public: anyone can read this; nobody can change it.
forked from benjivers/val
workbenchthis machine
Files 967e12d2fa288842a7c42ddda720f0c8a28efc34
| 1 | /** |
| 2 | * This map, bound to the engine's grid: the rows are the game's, the maths is |
| 3 | * shared with the browser, and the binding has to hand one to the other. |
| 4 | */ |
| 5 | |
| 6 | import { expect, test } from "bun:test"; |
| 7 | import { BODY_R } from "./engine/glide.ts"; |
| 8 | import { moveCircle } from "./map.ts"; |
| 9 | |
| 10 | test("the real map moves by the same maths", () => { |
| 11 | // Mid, walking east into whatever is there: the map's own binding. |
| 12 | const to = moveCircle(1200, 640, 9, 0, BODY_R); |
| 13 | expect(to.x).toBeGreaterThanOrEqual(1200); |
| 14 | expect(to.x).toBeLessThanOrEqual(1209); |
| 15 | expect(to.y).toBe(640); |
| 16 | }); |