OZONE Asylum
Forums
DHTML/Javascript
Need some help aiming an enemy sprite
This page's ID:
30701
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
First you need some kind of logical algorithm of what you want the 'AI' to be able to do. Ideally what you probably would want to do is something like this: (for every bot and every update/frame) 1) check if player is in range _2) check if player is in direct sight __3) calculate the direction __4) start turning in that direction __5) check if direction is approximately correct ___6) move forward ___7) shoot 8) if player is neither in range nor in sight _9) patrol For starters you can skip the 'in direct sight' check. edit: oops [small](Edited by [url=http://www.ozoneasylum.com/user/3736]Arthurio[/url] on 12-11-2008 09:30)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »