diff --git a/src/Documentation/collisionlayers.html b/src/Documentation/collisionlayers.html index 0fa8c20c..f7ec966b 100644 --- a/src/Documentation/collisionlayers.html +++ b/src/Documentation/collisionlayers.html @@ -81,14 +81,22 @@

CollisionLayers

Objects can be placed on different layers:

COLLISIONLAYERS
-===============      
+===============
 Background
 Target
 Player, Wall, Crate
-

The purpose of layers is twofold. -Firstly, it is about resolving movements: two objects on the same layer cannot coexist in a single cell. +

The collision layers are defined from back to front, each new line is a separate collision layer. The purpose of layers is twofold, resolving movements and determining draw order.

+ + + +

Firstly, it is about resolving movements: +Objects placed in the same collisionlayer can interact with each other through the rules (collide, push, pull) but two objects on the same layer cannot coexist in a single cell. If an object tries to move into a cell where there is already an object in that layer, it will be blocked.

+ +

By placing objects in different layers, two (or more) object types can exist in the same grid location, without one overwriting or removing the other. +In SokoBan this is typically used for the crates and the targets where the crates need to be placed. +Other example cases for separate CollisionLayers are: a Player that can climb Ladder tiles, a Train that can ride Rails, a Lightray that can overlap Ground tiles, and so on.

Secondly the order of layers determines in what order things are drawn. Objects are drawn from back to front, earlier objects are hidden by later ones.

The background layer is a special layer, below everything else. diff --git a/src/Documentation/images/collisionlayers.png b/src/Documentation/images/collisionlayers.png new file mode 100644 index 00000000..ff3f5f79 Binary files /dev/null and b/src/Documentation/images/collisionlayers.png differ