Module sensor
Adds qualitative collision detection to a Body.
A Sensor is simply a rectangular area that is attached to and moves with a
Body, but does not affect the physics of it. Sensors can detect
other Sensors they are overlapping. They can also detect whether they are
overlapping the map.
Sensor extends BoundObject
Properties
| on_static | (bool) (read only) Whether the Sensor is currently
overlapping the map. |
| on_sensors | (read only) A list of other Sensors this Sensor is currently
overlapping with. |
| body | (read only) The Body this Sensor is attached to. |
Class Methods
| Sensor:new (width, height, offset) | Create a new Sensor |
Properties
Properties. Significant fields on an instance.- on_static
-
(bool) (read only) Whether the
Sensoris currently overlapping the map. - on_sensors
-
(read only) A list of other
SensorsthisSensoris currently overlapping with. - body
-
(read only) The
BodythisSensoris attached to.
Class Methods
Class Methods. Must be called onClass, with a capital leading character.
e.g. Class:method("foo")