# use of contoller in bge

I have explore BGE for a long time.But I only know about how to use and,python and nand controller.Can anybody help me about how to use or,xor,nor,xnor and expression controller.

This question can be answered by reading the Blender manual, section Game Engine by clicking here.

## AND

Activates all connected actuators when all connected sensors are active.

## NAND

Activates all connected actuators when none connected sensors are active.

## OR

Activates all connected actuators when one or more (or all) connected sensors are active.

## NOR

Activates all connected actuators when one or more (or all) connected sensors are not active.

## XOR

Activates all connected actuators when one, and only one connected sensor is active.

## XNOR

Activates all connected actuators when one, and only one connected sensor is not active.

## Expression

Activates all connected actuators when the evaluated expression is true. A remark about this one: this controller is (after Python) the most powerful one, as you can evaluate complex expressions, which could demand several sensors, on a single line.

On Expression controller you can:

• Mix the previous controllers. Example: sensor1 AND sensor2 OR sensor1 AND sensor3.
• Check values of properties without the need of an Property sensor. Example: property > 0 OR property < 10.

I seriously recommend you to learn Python, but if you don't, learning the Expression controller can help you in making complex logic while avoids 'spaghetti code' on logic bricks.

## Python

As the name says, executes Python code. However, there's two modes: Script and Module.

Script mode runs a Blender text block. Using this mode is highly disencouraged, as it is pretty slow (as Python compiles it to bytecode each frame it runs) and harder to maintain (as it belongs to the blend file). This mode is only kept for backward compatibility.

Module runs a Python function. This function can be present inside a Blender text block or an external Python script (in both cases, the scripts must end with the extension .py). The field of the controller is a path to the function, which could follow the pattern script.function, folder.script.function, folder.subfolder.script.function, or any other pattern which fits your Python script.