Game Creation Kit: Last modified 02/02/07 17:04:05 cw
Prev | Chapter 27. Game LogicBricks | Next

# 27.2. Controllers

Controllers act as the brain for your game logic. This reaches from very simple decisions like connecting two inputs, simple expressions, to complex Python scripts which can carry artificial intelligence.

## 27.2.1. AND Controller

The AND Controller combines one, two or more inputs from Sensors. That means that all inputs must be active to pass the AND Controller.

## 27.2.2. OR Controller

The OR Controller combines one, two or more inputs from Sensors. OR means that either one or more inputs can be active to let the OR Controller pass the pulse through.

## 27.2.3. Expression Controller

With the Expression Controller you can create slightly complex game logic with a single line of "code". You can access the output of sensors attached to the controller and access the properties of the object.

| The expression mechanism prints out errors to the console or in the DOS window, so have a look there if anything fails.

More on using Expressions can be found in Section 26.9.

## 27.2.4. Python Controller

The Python controller is the most powerful controller in game engine. You can attach a Python script to it, which allows you to control your GameObjects, ranging from simple movement up to complex game-play and artificial intelligence.

Enter the name of the script you want to attach to the Python Controller into the "Script:" field. The script needs to exist in the scene or Blender will ignore the name you type.

| Remember that Blender treats names as case sensitive! So the script "player" is not the same as "Player".

Python for the game engine is covered in Chapter Section 28.2

#### Python methods:

``Actuator* getActuator`( char* name , );`

Returns the actuator with "name".

``list getActuators`( );`

Returns a python list of all connected Actuators.

``Sensor* getSensor`( char* name , );`

Returns the Sensor with "name".

``list getSensors`( );`

Returns a python list of all connected Sensors.

Prev | Home | Next
Game LogicBricks | Up | Actuators