this brain
Details
Kode wheel segment | Brains/Multibrain |
Style | Brain control |
Modifiers | in channel |
Primarily WHEN/DO | DO |
Pre-made brains that use it | Unknown |
Brains > Multibrain > this brain
Description
This tile is primarily used to set the current default brain to a brain variable. See example code.
Can also be used with Channel modifier.
Tutorial on Channels and slots
Example Code
WHEN [once] DO [brainvar:my brain][=][this brain]
Modifiers
None
Other Uses
None
e.g. I coded a cube which creates a volcano. To add lava streams I’m adding the brain of another cube several times. The Kode of these is like this:
W: Once D: this brain Direction.pos = random vector in circle
D: Paint.pos = High.pos + this brain Direction.pos x (Radius.num -0.5)
D: paint at position Paint.pos
D: turn vector this brain Direction.pos by random number -5 to 5
The main cube increases High.pos per frame and adds terrain. The Radius is cumulated to the high. The other brains it has in are using this variables but their Direction.pos will not be changed by the other brains.
So it can replace a brain.var when you’re inside your aiming brain.