Introduction to Behaviors

A gentle introduction to programming game logic visually with behaviors

behaviors intro 1

Getting Started with Behaviors

Behaviors are simple bits of logic that can be added to your game objects, and linked together to create unique and sophisticated game mechanics. No programming experience is required to get started.

Opening the Behavior Editor

To start adding behaviors to an object, click on any game object and select "Edit" to open that object's edit panel. Click on the "Behavior" button to open the behavior editor.

behaviors intro 2

Adding, Tweaking, and Removing Behaviors

On the left side of the editor is a menu of behaviors, grouped by category. To add a new behavior to your object just click one of the behavior buttons, and the behavior will appear in the editor window. The new behaviors can be arranged by dragging them.

Clicking on a behavior will open its properties panel, where you can edit its associated properties. The bottom of the properties panel also has a "Delete" button, which will remove this behavior and any of its links.

Note: in each behavior's properties panel there is a What's This icon that will open up information on that behavior when clicked.
objects panel

Linking Behaviors

Behaviors can be linked together to build sophisticated game logic and interactions.

Each behavior has a set of Ports on its left and right sides. Ports on the left side are input ports, and ports on the right side are output ports. To add a link between two behaviors, click on an output port, and drag a link to another behavior's input port. The link will turn green when it connects properly and can be released.

When there is a link you no longer want, just click on it to delete.

Whenever a behavior is triggered, it will send a message on its output links, triggering any behaviors it is connected to. In the picture to the left there is a Once trigger behavior, which fires once when the game starts. The Once behavior's output is connected to a Sound Effect behavior's input, This means that when this game starts, the sound effect will be played one time.

The sound effect's output isn't linked to any other behaviors, but if it was, they would be triggered after the sound effect is played.

objects panel

Types of Behaviors

Triggers are behaviors that are initiated by events occuring as the game is being played, such as key presses or object collisions. These trigger behaviors will in turn trigger other behaviors that make up your game logic.

Logic & Math behaviors are for performing arithmetic and controlling the flow of your logic.

Components are behaviors that perform a specialized task, such as playing a sound or adding a force to the object.

Properties allow access to directly update or extract the properties of a game object.

GUI behaviors are user interface widgets such as windows and labels.

Game Flow behaviors affect the flow of the game, and are used to restart or pause the game, or change levels.

For a detailed look at every behavior, see the Individual Behavior Documentation