Hi,
in draw->i use this code:
int n;
double mindist = 10000; //Initialize min distance with some high value
Actor *actors, *closest = NULL,*ACT;
//Get all actors that collides with the sensor actor
actors = getAllActorsInCollision("Event Actor", &n);
if(actors){
int i;
for(i = 0; i < n; i++){
if(strcmp(actors[i].name, "player") != 0){ //Ignore the player actor
double d = distance(player.x, player.y, actors[i].x, actors[i].y);
if(d < mindist){
closest = (actors + i);
if(strcmp(actors[i].clonename, "ENEMY") == 1){
strcpy(ID44.stringvar,actors[i].clonename);
ACT = getclone(actors[i].clonename);
ACT->HP = 1;
}
}
}
}
}
...it wotk. Well, but is possible change-> if(strcmp(actors[i].clonename, "ENEMY") == 1) with "any actor" in the game, this way' I can collide with any actores in game and to remove from them hp?
Tnk1000 for help.