The Dink Network

Reply to Re: Missile brain Question

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:
 
 
December 21st 2009, 05:36 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Yes you'll need some sort of loop. I'd just use get_next_sprite_with_this_brain() instead of get_sprite_with_this_brain()

int &counter = 1;
loop:
&tar = get_next_sprite_with_this_brain(9,1,&counter);
if (&tar == 0)
{
goto stop;
}
&counter = &tar;
//Do damage (that complicated thing you have there)
goto loop;
stop:


This will make sure you find every brain 9 enemy there is on the screen.

EDIT: Also, I don't know what happens if you do negative damage, which is kind of what you're doing for some sprites.