Graphics Reference
In-Depth Information
Figure 15-21 Properties for path nodes
The top property shown is named visible . It is an integer; therefore, Integer is selected from the property
type drop-down menu. Its start value is 0. This property will be used to toggle the visibility of the path nodes
in-game, in case this is necessary for troubleshooting. The second property is called pathnode . This property
is used only to identify that the object is a path node. The property's value will never be checked, only whether
the object has this property. For this reason, it is okay to leave the type as the default float type, and the default
value of 0.000.
The logic to toggle the visibility of the path nodes is shown in Figure 15-22 . The first sensor is a Keyboard
sensor that responds to the I key. When the I key is pressed, it triggers a Property actuator. Property actuators
come in three flavors: Assign, Add, and Copy. Assign is used to assign an arbitrary value to a property, Add is
used to increment or decrement a property value, and Copy is used to copy a value from another property to a
target property. In this case, you'll use the Add option with a value of +1. This means that when the I key is
pressed, the value of visible will be incremented by one.
 
 
Search WWH ::




Custom Search