Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Flowlab Behavior Cheat Sheet

Flowlab Behavior Cheat Sheet

A visual guide to Flowlab's circuit-based game development approach

Core Concepts: The Flowlab Paradigm

Circuit-Based Thinking

Flowlab uses a visual circuit approach rather than traditional programming. Logic flows through connected behaviors like electricity through a circuit.

Key Insight: Don't think in terms of code execution. Think in terms of signals flowing through connected pathways.

Signal Flow

Signals always flow left to right through connected behaviors:

Trigger
Logic
Component

Behavior Categories


Triggers
Start signals

Logic & Math
Decision making

Components
Actions

Properties
Object attributes

Multiplayer
Network features

SWITCH BEHAVIOR: Memory Element

Switch Anatomy

SWITCH
ON Port (Sets to ON)
OFF Port (Sets to OFF)
TOGGLE Port (Flips state)
Current: ON

Key Characteristics

  • Memory: Stores a boolean state (ON/OFF)
  • Persistence: Maintains state until changed
  • Output: Continuously outputs current state (1=ON, 0=OFF)
  • Control: Can be set, reset, or toggled via input ports
Important: Switches always output their current state, not just when triggered.

Common Switch Patterns

Memory Storage Pattern

Once → Switch (ON) → Output: 1
Action → Switch (TOGGLE) → Output changes

Stores game states like whose turn it is or if a door is unlocked

One-Time Event Pattern

Event → Filter (Switch = 0) → Action
               ↓
       Switch (ON)

Ensures an event only happens once (tutorials, achievements)

Toggle Feature Pattern

Button → Switch (TOGGLE)
Switch → Filter (= 1) → Feature ON
Switch → Filter (= 0) → Feature OFF

Creates on/off toggles for game features like sound

State Machine Pattern

Event → Switch A (OFF) → Switch B (ON)
                  ↓
       Actions for State B

Create multi-state systems with multiple switches

FILTER BEHAVIOR: Signal Gatekeeper

Filter Anatomy

FILTER
Condition:
Input Value > 5
Pass or Block Signal

Key Characteristics

  • Decision: Passes or blocks signal based on condition
  • Comparison: Tests incoming signal value against set condition
  • No Memory: Does not store state between signals
  • Value Preservation: Passes through original signal value if condition is met
Important: Filters don't create "else" paths - blocked signals simply stop.

Filter Operations

Equal (=)
Input value equals comparison value
Not Equal (≠)
Input value does not equal comparison
Greater Than (>)
Input value greater than comparison
Less Than (<)
Input value less than comparison
Greater/Equal (≥)
Input greater than or equal to comparison
Less/Equal (≤)
Input less than or equal to comparison

Filter Thinking Patterns

Signal Checkpoint Pattern

Mouse Click → Filter (correct_turn?) →
IF TRUE: Signal passes → Action
IF FALSE: Signal stops (nothing happens)

Basic conditional that only allows signals through when condition is met

AND Logic Chain

Signal → Filter A → Filter B → Action
(Both filters must pass the signal)

Creates AND logic by chaining filters in sequence

OR Logic Pattern

Signal → Filter A →
Signal → Filter B → OR block → Action

Creates OR logic with parallel paths to same action

Value Comparison

Number (score) → Filter (> 10) →
Signal passes if score > 10

Tests numeric values against thresholds

Powerful Behavior Combinations

Switch + Filter: Game State Management

Turn-Based System Example

Once
Switch
(turn)
Filter
(turn = 0)
Player 1
Turn
Move
Complete
Switch
(turn)
TOGGLE
Update
Turn Display

The Switch stores whose turn it is (0=Player1, 1=Player2). The Filter only allows actions when it's the correct player's turn. When a move completes, the Switch is toggled to change turns.

King Promotion in Checkers

Piece
Moved
Filter
(at end row?)
Switch
(is_king)
ON
Change
Sprite

When a piece reaches the opposite end of the board, the Filter detects this condition and allows the signal to pass. This turns ON the is_king Switch, which then changes the sprite and enables special movement rules.

Common Game Logic Patterns

Collision Detection

Collision
Trigger
Filter
(with enemy)
Take
Damage

Collision triggers when objects touch. The Filter checks which object type it collided with, allowing different responses for different objects.

Counters & Scoring

Collect
Item
Number
(+1)
Score
Property

The Number behavior adds the specified value to the object's property. In this case, it increments the score by 1 each time an item is collected.

Message Communication

Button
Click
Message
"open_door"
Signal travels between objects
Mailbox
"open_door"
Animation
"opening"

Messages allow communication between different objects. One object sends a message, and any object with the matching Mailbox behavior will receive it.

Movement Controls

Keyboard
Right
Number
(5)
Velocity
X input

Keyboard triggers activate when keys are pressed. The Number provides the movement speed value, which is sent to the Velocity behavior to move the object.

Switch vs. Filter: Quick Reference

Feature Switch Filter
Primary Purpose Store state (memory) Decision making (gatekeeper)
Persistence Maintains state until changed No persistence between signals
Output Behavior Constantly outputs current state Only outputs when input arrives and condition is true
Input Ports ON, OFF, TOGGLE Single input port
Common Uses Game states, toggles, one-time events Conditional checks, validation, signal control
Key Mental Model "Memory cell that stores and broadcasts state" "Gateway that only allows signals through when conditions are met"

The Power of Combination

The true power of Flowlab comes from combining switches (memory) with filters (decisions) to create complex, stateful game mechanics. Switches remember what's happened, and Filters make decisions based on that memory.

Flowlab Thinking Summary

Remember these key insights as you build your games:

Signal Flow, Not Code

Think in signals that travel through connected behaviors, not lines of code being executed.

Connections Are Everything

Unconnected behaviors won't communicate. Every signal path needs explicit connections.

State + Decision = Game Logic

Combine state storage (Switch) with conditional logic (Filter) for powerful game mechanics.