The Dink Network

Reply to Re: Multiple Brains?

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:
 
 
May 17th 2016, 08:49 PM
burntree.gif
This is how simple it is for a non-directional sprite:

void main(void)
{
sp_brain(&current_sprite, 9);
sp_speed(&current_sprite, 4);
sp_exp(&current_sprite, 15);
sp_base_walk(&current_sprite, -1);
sp_touch_damage(&current_sprite, 8);
sp_hitpoints(&current_sprite, 30);
preload_seq(871);

if (random(2,1) == 1)
{
sp_target(&current_sprite, 1);
}

int &fr = 1;
toploop:
sp_pframe(&current_sprite, &fr);
&fr += 1;
if(&fr > 10)
{
&fr = 1;
}
wait(66);
goto toploop;
}

void hit( void )
{
sp_target(&current_sprite, &enemy_sprite);
goto toploop;
}

void die( void )
{
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 6);

&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);

external("emake","small");

}