Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 718 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
shortest rotation #211035
06/14/08 15:18
06/14/08 15:18
Joined: May 2006
Posts: 90
England
TigerTao Offline OP
Junior Member
TigerTao  Offline OP
Junior Member

Joined: May 2006
Posts: 90
England
Im trying to figure out how to get my enemy to rotate the shortest way to the player. However with the pan angles constrianed to 0>180/0>-180, the flip from 180 to -180 is giving me no end of trouble.

Is there a good way of dealing with this in a simple manner?

Cheers

Re: shortest rotation [Re: TigerTao] #211036
06/14/08 15:24
06/14/08 15:24
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
i gues it is not 180 and -180 it is 0 and 360?


3333333333
Re: shortest rotation [Re: Quad] #211038
06/14/08 15:39
06/14/08 15:39
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
You can use the ang()-function.
Just have a look at this thread.

Re: shortest rotation [Re: Fenriswolf] #211042
06/14/08 16:12
06/14/08 16:12
Joined: May 2006
Posts: 90
England
TigerTao Offline OP
Junior Member
TigerTao  Offline OP
Junior Member

Joined: May 2006
Posts: 90
England
Thank you very much FenrisWolf

Your code works perfectly. Also if I change the order of entities in the vec_diff line, my enemies run away from me. Awesomeness!

Re: shortest rotation [Re: TigerTao] #211056
06/14/08 17:32
06/14/08 17:32
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
question frequency -> suggest placement in faq forum category:
ang function use in 'shortest rotation'



Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1