Skip to content

create_sprite

Prototypeint create_sprite(int x, int y, int brain, int sequence, int frame)

create_sprite() creates a new sprite with the given x, y, brain, sequence, and frame. It returns the active sprite number. Note that the sequence and frame are equivalent to sp_pseq() and sp_pframe().

It is strongly recommended to specify the brain, sequence, and frame, and don't set them to 0. There is a bug in the dink engine that can cause a newly-created sprite to run its touch procedure otherwise.

create_sprite() can be used to create rewards for killing a monster, like this red heart:

c
int &redheart = create_sprite(&save_x, &save_y, 6, 54, 1);
sp_script(&redheart, "heart");