The Daily Click ::. Forums ::. Klik Coding Help ::. Troublesome Trig'
 

Post Reply  Post Oekaki 
 

Posted By Message

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
11th June, 2003 at 09:26:48 -

Hi, I was wondering if the more mathematically minded of you could help me out with some Trigonometry (or at least I guess it would be trig that I need) to get this aiming system working? Let me explain:

The character has an aimer which spins around their head (much like worms, always a certain distance from the player). That's ok, I'm not using trig to do that. However, what I want to do is to check, using the angle of the aimer, whether the enemy is in line with it or not. THAT is my problem. I don't want to have to resort to shooting invisible rays, or stuff like that.

Anyone able to help?

 
191 / 9999 * 7 + 191 * 7

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
11th June, 2003 at 11:17:21 -

If you're using MMF, you can use Angle Calculator and compare the angle between the player and the aimer and between the player and the enemy. If they're close then it's aiming at it. Bet you don't understand.

 
gone fishin'

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
11th June, 2003 at 13:11:21 -

LOL, yeah I understand perfectly, and yes I have those extensions.

I never thought of that, thanks!!

 
191 / 9999 * 7 + 191 * 7

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
11th June, 2003 at 13:13:55 -

I am doing my maths GCSE in november, so i know what to do. The only thing: How do you do Tan-1? I have never used it so i don't know how. I can doTan but not Tan-1. I need to know this to help. I've nver used dir calculator, so it may be best

 
n/a

Long John Kickbag



Registered
  26/08/2002
Points
  148
11th June, 2003 at 16:48:15 -

People don't use it because the expression is really long as you have to do some stuff to add to the angle since atan only returns a value between -90 and +90. The expression won't work with two angle either because there will be a division by 0.

 
Resize! - www.clicksplat.com/comparison.html

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
11th June, 2003 at 17:20:45 -

ah, is it Atan? I guess that stands for arctan... thanx

 
n/a
   

Post Reply



 



Advertisement

Worth A Click