From a61c7a8a69be792e166312451fcb737fbaff0392 Mon Sep 17 00:00:00 2001 From: MelekTaus Date: Sat, 19 Sep 2026 13:13:30 +0200 Subject: [PATCH] One-way angle in Colliders, Physics, Tiles and Tilemaps, Development: check total 1075 (#159) Co-Authored-By: Claude Opus 5 --- Colliders.md | 14 ++++++++++---- Development.md | 2 +- Physics.md | 3 ++- Tilemaps.md | 8 +++++--- Tiles.md | 2 ++ 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Colliders.md b/Colliders.md index 3e0d90e..e06e754 100644 --- a/Colliders.md +++ b/Colliders.md @@ -81,11 +81,17 @@ block it. `Move` without the setting and `Set position` ignore colliders entirel A collider with **One-way** on (#155) blocks only what comes from one side: **Blocks from** says which — *Above* by default, or *Below*, *Left*, *Right* — in the collider's own axes, so it turns -and mirrors with its object. In the scene view that side is drawn thick. It is the platform a -figure jumps through from below and lands on from above: +and mirrors with its object. In the scene view that side is drawn thick, with a fan on its middle +showing the **One-way angle**. It is the platform a figure jumps through from below and lands on +from above: -- It blocks a contact whose normal lies within **45 degrees** of that side; anything else passes - - from below, and from the side as well, as in Unity and Godot. +- It blocks a contact whose normal lies within the **One-way angle** of that side — **45 degrees** + by default, 0 to 90 (#159); anything else passes - from below, and from the side as well, as in + Unity and Godot. The angle counts where the surface is not square to that side: on a slope of + 25 degrees in a polygon blocking from *Above*, a figure lands at 25 degrees or more and falls + through below that. At 90 degrees the sides block too, only what comes from the opposite side + passes. +- *Blocks from* and *One-way angle* show in the inspector only while *One-way* is on. - What is already inside it passes on through for as long as it is inside, so a jump that did not clear the top falls back out below. - `Move` with *Collide with solids* reports `hit` only where it was stopped, and a fast fall is diff --git a/Development.md b/Development.md index 37832a8..d50edd9 100644 --- a/Development.md +++ b/Development.md @@ -12,7 +12,7 @@ npm run check # typecheck + lint + format:check + tests, the gate CI runs # code is lost (tail's is reported), so a red run reads as green npm run build # writes dist/ and regenerates index.html ./build.sh # the same under `set -o pipefail`, for callers that pipe the output -node tools/seed-e2e.mjs && node tools/e2e.mjs # 1074 editor checks, screenshots in /tmp/gm-e2e-*.png +node tools/seed-e2e.mjs && node tools/e2e.mjs # 1075 editor checks, screenshots in /tmp/gm-e2e-*.png GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step ./e2e.sh start [GM_STEPS] # the same run detached, see below ./e2e.sh status # live progress, or the last run's result diff --git a/Physics.md b/Physics.md index 65d510f..0432764 100644 --- a/Physics.md +++ b/Physics.md @@ -108,7 +108,8 @@ one-way collider is worked out **before every step**: - It **lands** when it is on the blocking side or sunk in no deeper than 2 units (a landing at 60 steps per second sinks in 1.9 before the engine pushes it out), the contact faces that side - within 45 degrees, and it is not moving away from it. + within the collider's or tile's one-way angle (45 degrees by default, #159), and it is not moving + away from it. - Once landed it is **held** as long as the two overlap: a body falling 2000 units per second is 13 units into an 8 units thick platform one step later, and is pushed back up instead of passing. - Otherwise it passes, and so does a body told to by `Ignore one-way`. A resting body is woken for diff --git a/Tilemaps.md b/Tilemaps.md index 13faf9f..52a600c 100644 --- a/Tilemaps.md +++ b/Tilemaps.md @@ -210,9 +210,11 @@ There are no trigger tiles yet: a tile blocks or it does not. A solid tile with **One-way (from above)** on (#155) blocks only what comes down on it from above, like a one-way collider blocking from *Above* (see [Colliders](Colliders#one-way)): a figure jumps through from below and from the side, lands on top, and falls through with `Ignore one-way`. Above -means the map's top, turned with it. One-way cells are merged into rectangles the same way, but only -with each other — a platform next to a wall is two shapes, so the wall never blocks from below only. -In the scene view they are outlined thinner, their top drawn thick. +means the map's top, turned with it. The tile's **One-way angle** (45 degrees by default, #159) is +how far a contact may lean from straight up and still land, as on a collider. One-way cells are +merged into rectangles the same way, but only with each other and only with tiles of the same angle — +a platform next to a wall is two shapes, so the wall never blocks from below only. In the scene view +they are outlined thinner, their top drawn thick with the fan of their angle on its middle. ## In the project file diff --git a/Tiles.md b/Tiles.md index b61def4..f7c471d 100644 --- a/Tiles.md +++ b/Tiles.md @@ -62,6 +62,8 @@ asks for; a picture that does not fit is kept and named, never silently dropped. every layer (#132); see [Tilemaps](Tilemaps#collision). - **One-way (from above)** — off by default. A solid tile with it on blocks only from above: a platform one jumps through from below (#155); see [Tilemaps](Tilemaps#one-way-tiles). +- **One-way angle** — 45 by default, 0 to 90, shown while *One-way* is on. How far a contact may + lean from straight up and still land on the tile (#159). - **Collision scale** — 1 by default. How big a solid cell blocks against its square, drawn in or out only on the sides without a blocking neighbour (#140); see [Tilemaps](Tilemaps#collision-scale).