Page 1 of 1

AI...so frusterating

PostPosted: Fri Jun 22, 2007 4:57 pm
by J Maker
hey sorry but i know this has been asked about a bagillion
but i need some codes so that my boss actor moves towards my player and changes animation when he is walking left and right but he always stays on tha ground so can anyone help me? ',:|

PostPosted: Fri Jun 22, 2007 5:00 pm
by Caaz Games
The way i did it is like This
[] = zones
8 Boss

[___]8[___]

One would trigger left on a collision event with the player actor.
other would be reverse.

PostPosted: Fri Jun 22, 2007 5:04 pm
by Oman
ok, here u go :)
put in enemy, collision wit top side of ground, reapeat wile colliding no,
and put the enemy starting above the ground, and give him "gravity"

if (xvelocity > +0.00001)
{
right animation
}

else if (xvelocity < -0.00001)
{
left animation
}

PostPosted: Fri Jun 22, 2007 5:05 pm
by J Maker
The way i did it is like This
[] = zones
8 Boss

[___]8[___]

One would trigger left on a collision event with the player actor.
other would be reverse.
ok so: [___] is a filled region?
i think i get it! :D thx ill try it

PostPosted: Fri Jun 22, 2007 5:06 pm
by Caaz Games
Correct

PostPosted: Fri Jun 22, 2007 5:22 pm
by J Maker
ok, oman i that code just for chnging animations then? and cool im right at something :D

PostPosted: Fri Jun 22, 2007 5:23 pm
by Oman
yep, isn't that what you wanted?

PostPosted: Fri Jun 22, 2007 5:36 pm
by J Maker
:Dyep