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 Discussion / How would you do 1 ai loop for mutilple enemies?

Author
Message
Dr Crazy
21
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 20th Jun 2004 13:05
The Subject.

Who dares; wins.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 20th Jun 2004 17:50
Well, here's what I do. I have objects 200 to 300 reserved for enemies. Whenever my game needs a new enemy, I do a for/next loop to find an object number not in use and call my CreateEnemy function. I then use a for/next loop to loop through the objects, and if the object exists, then call the function to update the AI for it. My code for updating the AI looks something like this:


There are probably better ways to do this, but this is how I do it and it works quite well as long as you don't have too many enemies roaming around.

Login to post a reply

Server time is: 2025-05-28 01:38:34
Your offset time is: 2025-05-28 01:38:34