Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
So I've made a little GPS like system for my program and have AI moving from point to point based on that instead of the actual coordinate system used in the construct 2 editor. How can I find the angle of the line between two points so my bots know which way to go? (the built in angle function leads to my bots getting stuck sometimes)
Edit: I've tried using the atan function but it only works for angles between 90 to 270
set player angle to, (a, b, c, d)
a, b coordinates of first point, and c,d coordinates of the second point
Are the graphics of the bots lined up with the zero angle ?
In C2 that zero angle is to the right. (east)
I can't use angle(a,b,c,d). My GPS doesn't line up with the actual points in the editor so if I use angle it won't be correct. I read that in a lot of programs there's a function called Atan2 but Construct doesn't have it and the graphics are lined up with the 0 degree position
angle(x1,y1, x2,y2) is the same as atan2(y2-y1, x2-x1)
Develop games in your browser. Powerful, performant & highly capable.
Oh my god, I'm an idiot XD I forgot that when using atan2 you have to do the subtraction to make it into 2 variables, no wonder it wasn't working. Thank you!