Enemy angle based on player position
Enemy angle based on player position
Enemy angle based on player position
Enemy angle based on player position
Enemy angle based on player position
Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position
Enemy angle based on player position Enemy angle based on player position
Enemy angle based on player position
Go Back  Xtreme Visual Basic Talk > > > Enemy angle based on player position


Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2005, 09:18 AM
GBInFlames's Avatar
GBInFlames GBInFlames is offline
Freshman
 
Join Date: Jul 2005
Location: Ontario
Posts: 24
Question Enemy angle based on player position


Im trying to program some simple ai, but i can't seem to get my enemys to chase my player because im not sure how to get the enemys rotation angle relative to the player position for example, say that the enemy's X,Y is 50,50 and he is currently facing at an angle of 0 deg (looking up in the window) and my player is at 25,75, that would put the player above and to the right of the enemy (in an overhead world), now i know that i have to find the distance between the enemy and the player, and then eventually use the sine and cosine to get the enemy to rotate and move towards the player, but what i want to know is how to get the angle that the enemy must fact inorder to walk in the direction of the player.

I know there is probably a solution to this question somewhere within this forum, but i've been searching for over 4 hours and haven't found it, well at least i haven't found a solution that i can get to work, so any help would be greatly appreaciated. Thx in advance
Reply With Quote
  #2  
Old 07-22-2005, 09:28 AM
passel's Avatar
passelEnemy angle based on player position passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,024
Default

Search for ArcTangent.

Did you try this thread?
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #3  
Old 07-22-2005, 09:49 AM
StressedGeezer's Avatar
StressedGeezer StressedGeezer is offline
Junior Contributor
 
Join Date: Apr 2004
Location: Cambridge, England
Posts: 259
Default

What about this thread ?
__________________
Geezer
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Enemy angle based on player position
Enemy angle based on player position
Enemy angle based on player position Enemy angle based on player position
Enemy angle based on player position
Enemy angle based on player position
Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position Enemy angle based on player position
Enemy angle based on player position
Enemy angle based on player position
 
Enemy angle based on player position
Enemy angle based on player position
 
-->