• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED Left or Right? Making this... *Solved* ...and I feel dumb.

Selva

Member
So. I updated GMS2 as soon as I went back to making games. I was... out for a while. I'm using IDE version 2.3.1.542. A lot has changed.
Anyway.
I'm using GML for this project.
My missile needs to know whether it needs to turn left or turn right to arc it's way towards the supposedly doomed player. But it's just not that simple. Crossing over the 0/360 line does not jive with easy math. (If missile is heading in direction 10 and player is in direction 350, basic math says turn left. Because 10 is way less than 350.) I KNOW there is a relatively simple formula to work this out. I remember being shown it by a math major about 6 years ago. But I have no idea what it was/is. I realize I'm a mathematically stunted twit but I'm trying. I just can't get anywhere with it. If anyone could give me a clue it would be greatly appreciated.
Please and Thank You in advance,
- Selva
 
Top