A.I.

Talk about making games.

A.I.

Postby Freddy » Wed Jun 20, 2007 4:31 pm

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.
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Postby Troodon » Wed Jun 20, 2007 7:24 pm

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.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Re: A.I.

Postby Sgt. Sparky » Wed Jun 20, 2007 11:57 pm

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
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Re:

Postby Darc » Mon Mar 30, 2009 8:27 pm

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
Image
User avatar
Darc
 
Posts: 16
Joined: Sun Mar 29, 2009 2:07 am
Score: 0 Give a positive score

Re: Re:

Postby BlarghNRawr » Mon Mar 30, 2009 11:56 pm

Darc wrote:that otter said 360


talking otter? :D
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest