if(strcmp(creator.name, "GoldCoinChest")==0)
ChangeAnimationDirection("Event Actor", STOPPED);//The animation is a rotation animation with frames of about 10 degrees, but footsteps alternating, so to get a good animation, the frame has to be changed often.
groundBased=1;//a variable I will use later, when a shockwave travels along the ground, destroying anything 'Ground based'.
//circle Char if close enough
if(distance(x, y, Char.x, Char.y)<=110)
{
if(bin==0)//bin is just an actor integer, to be used as a binary (true or false) variable. Each actor uses it dierently.
{
CreateTimer("Event Actor", "Rand", 5000);
dir=2;//a variable used, in this case, to determine animation changing, as in the comment above.
bin=1;
ChangeParent("Event Actor", "Char");
directional_velocity=3;
angle=direction(x, y, Char.x, Char.y)+90;
}
}
//stop circling when too far away.
else if (distance(x, y, Char.x, Char.y)>=140)
{
ChangeParent("Event Actor", "no parent");
directional_velocity=0;
DestroyTimer("Rand");
bin=0;
}
//activate different movement patterns
if(dir==0)
{
wulvVar+=1;
if(wulvVar>=10)
{
angle+=10;
dir=1;
}
}
else if(dir==1)
{
wulvVar-=1;
if(wulvVar<=0)
{
angle-=10;
dir=0;
}
}
else if(dir==2)
{
angle+=1;
}
else if (dir==3)//for a collision, I will change circle direction.
{
angle-=1;
}
//show direction
animpos = (angle/360.0)*nframes;
dir=1;//change movement pattern
angle=direction(x, y, Char.x, Char.y);//change direction
DilloDude wrote:He doesn't fall down it as soon as he hits it, but when all of him is hitting it.
Users browsing this forum: No registered users and 1 guest