Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Rotate enemy towards player

Author
Message
Bren
22
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Belgium
Posted: 5th Nov 2003 00:47
I need my enemies to "follow" my player when he walks by. In other words I need code to rotate the enemies towards my player.

I have tried:

And I tried the atanfull function, but they don't work.

If anyone can explain me how it's done properly that would be nice.
As you can see the enemies don't have to look up or down, just rotate around the Y axis.

And I would also want to know if using a hidden pyramid as the enemy's field of view is a good and efficient idea.

Games don't kill ...
I do!
http://www.gamingzone.be the ultimate gaming community
zircher
23
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 5th Nov 2003 03:42
See the AI Required thread for a possible low tech solution.
--
TAZ
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 5th Nov 2003 17:11
point object enemyObject,object position x(playerObj),object position y(enemyObj),object position z(playerObj)

Note that Y=enemyObj for use on ground with hills, if you had a spaceship or submarine game you would give it playerObj.

Pneumatic Dryll
Bren
22
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Belgium
Posted: 5th Nov 2003 21:27
Thanks alot drill!

Games don't kill ...
I do!
http://www.gamingzone.be the ultimate gaming community

Login to post a reply

Server time is: 2026-07-26 16:03:23
Your offset time is: 2026-07-26 16:03:23