LuaAPI: add SetGearCollisionMask constants
authorWuzzy
Tue, 17 Apr 2018 00:59:52 +0100
changeset 1301 d4d6bc1dc1de
parent 1300 dff2be85c8d2
child 1302 3083c0d7e422
LuaAPI: add SetGearCollisionMask constants
LuaAPI.wiki
--- a/LuaAPI.wiki	Tue Apr 17 00:50:26 2018 +0100
+++ b/LuaAPI.wiki	Tue Apr 17 00:59:52 2018 +0100
@@ -78,6 +78,7 @@
 || *Identifier* || *Description* ||
 || `LAND_WIDTH` || The width of the landscape in pixels ||
 || `LAND_HEIGHT` || The height of the landscape in pixels ||
+|| `LOCALE` || Current locale identifier (e.g. “de” for German) ||
 || `LeftX` || X coordinate of the leftmost point of the landscape ||
 || `RightX` || X coordinate of the rightmost point of the landscape ||
 || `TopY` || Y coordinate of the topmost point of the landscape ||
@@ -777,22 +778,23 @@
 
 `mask` is a number between `0x0000` and `0xFFFF` and used as a bitfield, which means you can combine these flags with `bor`. These are the available flags (excerpt):
 
-|| *Flag* || *Collision with …* ||
-|| `0xFF00` || Terrain ||
-|| `0x0080` || Current hedgehog and crates ||
-|| `0x000F` || Other hedgehogs ||
-|| `0x0070` || Mines and explosives ||
+|| *Idntifier* || *Collision with …* ||
+|| `lfLandMask` || Terrain ||
+|| `lfCurrentHog` || Current hedgehog and crates ||
+|| `lfHHMask` || Hedgehogs except current hedgehog ||
+|| `lfNotHHObjMask` || `not lfNotHHObjMask` ||
+|| `lfAllObjMask` || Mines and explosives ||
 
 Beware, the collision mask is often set by the engine as well.
 
 Examples:
-<code language="lua">SetGearCollisionMask(gear, 0xFF7F)
+<code language="lua">SetGearCollisionMask(gear, bnot(lfCurrentHegehog))
 -- Ignore collision with current hedgehog</code>
 
 <code language="lua">SetGearCollisionMask(gear, 0xFFFF)
 -- Collide with everything</code>
 
-<code language="lua">SetGearCollisionMask(gear, 0x00FF)
+<code language="lua">SetGearCollisionMask(gear, bor(bor(lfHHMask, lfCurrentHog), lfAllObjMask))
 -- Collide with hedgehogs and objects</code>
 
 <code language="lua">SetGearCollisionMask(gear, 0x0000)