Appearance
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.
Brain | Name | Description |
---|---|---|
0 | None | No pre-defined behavior. |
1 | Human/Dink | Player-controlled via keyboard, and gamepad input. |
2 | Bounce | Sprite will bounce back and forth across the screen. No known practical uses. |
3 | Duck | A 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. |
4 | Pig | A pig that walks around, randomly playing sounds 2, 3, 4, and 5 (pig grunts). If killed, will play sequence 164. |
5 | Sequence (corpse) | Plays through the current sequence and kills the sprite, but leaves the last frame drawn to the background. |
6 | Repeat | Will repeat the current sequence over and over again. |
7 | Sequence (No trace) | Plays through the current sequence and kills the sprite, and does not leave any trace behind. |
8 | Text | Probably a text sprite. |
9 | Diagonal enemy | An 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. |
10 | Lateral enemy | An enemy that constantly walks around using lateral directions 2, 4, 6, and 8. Will call attack procedure based on sp_attack_wait(). |
11 | Missile (repeat) | Will repeat the current sequence over and over again, and damage sprites in range. |
12 | Scale | Shrinks or grows to match the size value stored in sp_brain_parm() and kills the sprite. |
13 | Mouse | Player-controlled via mouse input. |
14 | Button | Calls buttonon() and buttonoff() functions in the sprite's script if sprite 1 (Dink) is within its hardbox. |
15 | Shadow | Mirrors the parent sprite's (stored in sp_brain_parm()) attributes x, y, and size. Will die automatically with the parent sprite. |
16 | Smart | The sprite will walk around, stop, look around, and walk some more. |
17 | Missile (once) | Will play the current sequence once, damage sprites in range, and die. |