The Dink Network

Explosions

August 24th 2006, 06:11 AM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
I've done a sprite that can walk around as he wishes, but I want an explosion to appear ON him when I talk to him... The problem is he's moving the whole time, is it possible to spawn the explosion on him there he stands after walking around by himself?
August 24th 2006, 06:21 AM
peasantmg.gif
ehasl
Peasant He/Him
 
Yes. It is easy. You just make two variables for x and y coordinates and use sp_x(&current_sprite,-1) and the same with sp_y to get the coordinates that you can give the new sprite, also using sp_x and sp_y, but on the newly created explosion sprite, or in the create_sprite. I can show you:

void talk()
{
int &man_x = sp_x(&current_sprite,-1);
int &man_y = sp_y(&current_sprite,-1);
int &manexplode = create_sprite(&man_x,&man_y,int brain,int sequence,int frame);
// if you use a shadow brain, then the explosion will follow the man's movements if he continues to move. Hehe, imagine the man just sets himself on fire when you talk. You can add more commands under here, for example if you want the man dead or if you want to give the explosion sprite more properties.
}
August 24th 2006, 06:28 AM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
Ok thanks, and if I want the explosion to just appear once and then disappear I could use brain 7?
August 24th 2006, 07:12 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Yep. But you'll probably have to call sp_seq(&manexplode, int seq); to actually start the animation.
August 24th 2006, 08:23 AM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
Ok, I'll try that thanks both of you!