Module SCA_PythonController :: Class SCA_PythonController
[hide private]
[frames] | no frames]

Class SCA_PythonController

source code

SCA_ILogicBrick.SCA_ILogicBrick --+    
                                  |    
    SCA_IController.SCA_IController --+
                                      |
                                     SCA_PythonController

A Python controller uses a Python script to activate it's actuators, based on it's sensors.

Instance Methods [hide private]
list [SCA_ISensor]
getSensors()
Gets a list of all sensors attached to this controller.
source code
SCA_ISensor
getSensor(name)
Gets the named linked sensor.
source code
list [SCA_IActuator]
getActuators()
Gets a list of all actuators linked to this controller.
source code
SCA_IActuator
getActuator(name)
Gets the named linked actuator.
source code
string
getScript()
Gets the Python script this controller executes.
source code
 
setScript(script)
Sets the Python script this controller executes.
source code
int
getState()
Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active.
source code

Inherited from SCA_ILogicBrick.SCA_ILogicBrick: getExecutePriority, getOwner, setExecutePriority

Method Details [hide private]

getSensor(name)

source code 

Gets the named linked sensor.

Parameters:
  • name (string)
Returns: SCA_ISensor

getActuator(name)

source code 

Gets the named linked actuator.

Parameters:
  • name (string)
Returns: SCA_IActuator

setScript(script)

source code 

Sets the Python script this controller executes.

Parameters:
  • script (string.)

getState()

source code 

Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. This for instance will always be true however you could compare with a previous state to see when the state was activated. GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState()

Returns: int