Page 1 of 1

A.I.

PostPosted: Wed Jun 20, 2007 4:31 pm
by Freddy
I need a simple A.I. code so that my attacker will switch animations according to the direction it is going, and follow my actor on the x axis. Jumping would be good. :D
any help is appreciated.

PostPosted: Wed Jun 20, 2007 7:24 pm
by Troodon
Have you got animations for the rotating enemy?
To make him look to the direction he is going, put this in his draw actor code:
Code: Select all
animpos = (angle / 360) * nframes;


To make him follow you, check in the same draw actor if the x value is smaller or greater than your actor's x value and then just move slowly.
:) I hope this helped little.

Re: A.I.

PostPosted: Wed Jun 20, 2007 11:57 pm
by Sgt. Sparky
Freddy wrote:I need a simple A.I. code so that my attacker will switch animations according to the direction it is going, and follow my actor on the x axis. Jumping would be good. :D
any help is appreciated.

I made a Fighting Demo, but it does not have Jumping.
I can tell you how to add it though. :D
http://game-editor.com/forum/tp-3579-Fi ... Game-.html

Re:

PostPosted: Mon Mar 30, 2009 8:27 pm
by Darc
Troodon wrote:Have you got animations for the rotating enemy?
To make him look to the direction he is going, put this in his draw actor code:
Code: Select all
animpos = (angle / 360) * nframes;


To make him follow you, check in the same draw actor if the x value is smaller or greater than your actor's x value and then just move slowly.
:) I hope this helped little.

that otter said 360

Re: Re:

PostPosted: Mon Mar 30, 2009 11:56 pm
by BlarghNRawr
Darc wrote:that otter said 360


talking otter? :D