It says:
Error line 27 Wrong number of arguments for MoveTo
int n;
double mindist = 10000; //Initialize min distance with some high value
Actor *actors, *closest = NULL;
//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, "tree") == 0) //On tree actors
{
double d = distance(player.x, player.y, actors[i].x, actors[i].y);
if(d < mindist)
{
//Hold the closest actor
closest = (actors + i);
mindist = d;
}
}
}
}
//Move the closest actor, if any
if(closest)
{
MoveTo(closest->clonename, 0, 0, 5, "player", "");
}
int n;
double mindist = 10000; //Initialize min distance with some high value
Actor *actors, *closest = NULL;
//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, "tree") == 0) //On tree actors
{
double d = distance(sini.x, sini.y, actors[i].x, actors[i].y);
if(d < mindist)
{
//Hold the closest actor
closest = (actors + i);
mindist = d;
}
}
}
}
//Move the closest actor, if any
if(closest)
{
MoveTo(closest->clonename, 0, 0, 5, "player");
}
Users browsing this forum: No registered users and 1 guest