WorldObject.GetAllowStacking

From Dominoze

Jump to: navigation, search


function GetAllowStacking()


Description

In a Dominoze game, players can move objects from one place to another. In some cases, the game wants to allow users to move objects on top of other objects; such as tables, shelves, or boxes. However, there are other cases where the user should not be allowed to do so; such as on a plant, a ball, or a lightweight object that should not sustain any mass on itself. This function reveals whether the user is allowed to move an object on top of another object.


Return Values

Zero if stacking is not allowed, or non-zero if it is allowed.


Example

In a world object script, this function will fill allow_stacking in with a number that reflects whether the player can stack objects onto it or not.

function OnSimulationBegin(world_object)
   local allow_stacking = world_object:GetAllowStacking();
end
Personal tools