The Dink Network

Reply to Re: Complicated Dink C

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 13th 2006, 03:19 PM
goblinm.gif
So what makes missile brains special is that they have a damage procedure. This means that we can do:

//explosio.c
void main( void )
{
//set sequences and such
sp_seq(&current_sprite, 70);
...
...
...
sp_brain_parm(&current_sprite, 1);
//^this means it can't hit Dink
sp_nodraw(&current_sprite, 1);
//make it invisible, most of the time
}

void damage( void )
{
int &my_brain = sp_brain(&missile_target, -1);
//missile_target is the thing hit by the missile, IIRC
if (&my_brain == 9)
{
int &get_x = sp_x(&missile_target, -1);
int &get_y = sp_y(&missile_target, -1);
sp_x(&current_sprite, &get_x);
sp_y(&current_sprite, &get_y);
//^Center it on target if target has monster brain
sp_nodraw(&current_sprite, 0);
//^Make it visible if target has monster brain
}
}