Skip to content

sp_brain

Prototypeint sp_brain(int active_sprite, int brain[-1])

sp_brain() gets or sets the brain for the active_sprite.

A brain defines how a sprite behaves. Several sprite functions are only compatible with specific brains.

BrainNameDescription
0NoneNo pre-defined behavior.
1Human/DinkPlayer-controlled via keyboard, and gamepad input.
2BounceSprite will bounce back and forth across the screen. No known practical uses.
3DuckA duck that walks around, randomly playing sound 1 (a duck's quack).
First time hit, will create a new sprite use pseudo-base sequence 120 to make the duck's head fly off. The duck will use base sequence 110 to walk around, and play random blood spurts.
Second time hit, will kill the sprite, and play sequence 164.
4PigA pig that walks around, randomly playing sounds 2, 3, 4, and 5 (pig grunts). If killed, will play sequence 164.
5Sequence (corpse)Plays through the current sequence and kills the sprite, but leaves the last frame drawn to the background.
6RepeatWill repeat the current sequence over and over again.
7Sequence (No trace)Plays through the current sequence and kills the sprite, and does not leave any trace behind.
8TextProbably a text sprite.
9Diagonal enemyAn enemy that constantly walks around using directions 1, 3, 7, and 9. Will attack if proper values (sp_base_attack(), sp_distance(), sp_range(), sp_attack_wait()) are set.
10Lateral enemyAn enemy that constantly walks around using lateral directions 2, 4, 6, and 8. Will call attack procedure based on sp_attack_wait().
11Missile (repeat)Will repeat the current sequence over and over again, and damage sprites in range.
12ScaleShrinks or grows to match the size value stored in sp_brain_parm() and kills the sprite.
13MousePlayer-controlled via mouse input.
14ButtonCalls buttonon() and buttonoff() functions in the sprite's script if sprite 1 (Dink) is within its hardbox.
15ShadowMirrors the parent sprite's (stored in sp_brain_parm()) attributes x, y, and size. Will die automatically with the parent sprite.
16SmartThe sprite will walk around, stop, look around, and walk some more.
17Missile (once)Will play the current sequence once, damage sprites in range, and die.