From 35021843cfab4365575f0fefc6aa4d5bb8bb482d Mon Sep 17 00:00:00 2001 From: Ashley N Date: Thu, 7 Sep 2023 21:16:52 +0000 Subject: [PATCH] Update Design Doc: `level` tool --- Design-Doc%3A-%60level%60-tool.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Design-Doc%3A-%60level%60-tool.md b/Design-Doc%3A-%60level%60-tool.md index 9768a0b..de13ccf 100644 --- a/Design-Doc%3A-%60level%60-tool.md +++ b/Design-Doc%3A-%60level%60-tool.md @@ -25,7 +25,10 @@ The string property `reskit-layer` set on a Tile Layer indicates which layer sho Tile layers without `reskit-layer` set are ignored by the `level` tool. ## Collision Map -The boolean property `reskit-collision` set on a Tile Layer to `true` indicates which layer should be used for building the tile collision map. Any non-zero item placed indicates a tile which the player is not permitted to pass through. How you implement this is up to your game engine - reskit will simply save the collision map in a `.bin` file as an artifact. +The boolean property `reskit-collision` set on a Tile Layer to `true` indicates which layer should be used for building the tile collision map. Any non-zero item placed indicates a tile which the player is not permitted to pass through. How you implement this is up to your game engine - reskit will simply save the collision map in a `.bin` file as an artifact (`collision.bin`). + +### Format of the Collision Map +The collision map is just an array of 8-bit unsigned integers laid out with the same tile dimensions as your visible layers. 0 is a free area, while 1 is a collision area. ## Entity-Component System Reskit assumes a best-practice entity-component engine design and the objects defined in your .tmx file effectively serve as the entities. By adding a property `reskit-component[x]` to each object, where x is the index of the component in an array, you can attach various components to the target object/entity. Each component may have various properties you choose to define, which can be formatted as Tiled property `reskit-component[x].y`, where x is the index of the component and y is the property name for that component. If multiple object layers are defined, reskit will collapse all of them into a single layer.