Pathfinding data

This commit is contained in:
2026-11-21 13:16:12 -03:00
parent 277664d2d9
commit dd53613758
6 changed files with 32 additions and 0 deletions
+7
View File
@@ -87,6 +87,13 @@ Deno.test("an entity without a model is drawn as its texture, and a scripted one
assertEquals(validate_entity({ id: "a:b", texture: "a:b", behavior: "a:flying", width: 0.25, height: 0.25 }), []);
});
Deno.test("an entity can say it doesn't jump and how far it drops, in whole blocks", () => {
const entity = { id: "a:b", texture: "a:b", width: 1, height: 1 };
assertEquals(validate_entity({ ...entity, jumps: false, max_fall: 0 }), []);
assertEquals(validate_entity({ ...entity, max_fall: 1.5 }).length, 1);
assertEquals(validate_entity({ ...entity, max_fall: -1 }).length, 1);
});
Deno.test("an entity's category is monster for monsters unless it says otherwise", () => {
const entity = { id: "a:b", texture: "a:b", width: 1, height: 1 };
assertEquals(entity_category(entity), "creature");