- Code: Select all
int HP[4];
- Code: Select all
HP[0]=80;
HP[1]=120;
HP[2]=60;
HP[3]=40;
- Code: Select all
int i
for(i=0;i<4;i++)
{
if(HP[i]<0)
{
DestroyActor("enemy.i");
}
}
int HP[4];
HP[0]=80;
HP[1]=120;
HP[2]=60;
HP[3]=40;
int i
for(i=0;i<4;i++)
{
if(HP[i]<0)
{
DestroyActor("enemy.i");
}
}
int hp[4]; // 4 because you only have 4 enemies, make larger for more
hp[cloneindex]=20; // makes it have 20 health (each enemy)
// if you want you could do 20*cloneindex so each enemy would have 20 more than the next
hp[cloneindex]-=1; // for subtracting 1 hit point
if(hp[cloneindex]<=0)// if "my" health is less than or equal to zero (ie dead)
DestroyActor("Event Actor");
hp = 20;
hp-=1;
if(hp<=0)DestroyActor("Event...");
switch(cloneindex)
{
case 0:hp = 20; // if the cloneindex is 0 ie the first made one
break;
case 1:hp = 60;
break;
// continue for others (2, 3)
}
jimmynewguy wrote:is the array way to do it. but its much simpler to make an actor variable called hp then on create actor
- Code: Select all
hp = 20;
Users browsing this forum: No registered users and 1 guest