利用者:Sculptorjim/Game Engine/Logic/Sensors/Overview

提供: wiki
< 利用者:Sculptorjim‎ | Game Engine‎ | Logic‎ | Sensors
2012年1月11日 (水) 22:04時点におけるwiki>Sculptorjimによる版
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Sensors

Sensors are what cause the game logic to do anything. Sensors can be triggered by events such as a nearby object, a key pressed on the keyboard, timed events, etc. When a sensor is triggered, a positive pulse is sent to all controllers that are linked to it.

Sensors fire pulses to controllers. The pulses can be TRUE or FALSE. Different parameters on the sensor's logic brick control when a sensor fires what pulse. This is extremly important as it has direct influence on the game logic and the performance. It is up to the controllers how to react on TRUE and FALSE pulses.

Sensors will fire pulses to connected controllers. These can be either:

Individual pulses when the sensor detects an event, or
Sequences of repeated pulses, fired at a rate of 60Hz (or some lower frequency determined by a user setting).
The pulses sent by sensors can send TRUE or FALSE pulses.

Sensor Types

The following types of actuator are currently available:

Actuator Senses when the specified actuator is activated.
Always Gives a constant stream of output pulses.
Collision Senses when object collides with another object with specified name and property.
Delay Gives an output pulse after a specified delay.
Joystick Detects joystick events.
Keyboard Detects keyboard events.
Message Detects messages sent from elsewhere in the game logic.
Mouse Detects mouse events.
Near Gives an output pulse whenever another object comes within a specified distance.
Property Detects changes in a specified property.
Radar Gives an output pulse whenever another object comes within a cone region of specified distance and angular spread.
Random Generates pulses with random intervals.
Ray Gives an output pulse whenever a ray along a specified axis intercepts another object.
Touch Detects when the object touches (or separates from) another object.