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
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
Unless the distance expression shouldn't give back the distance between two points, I think this expressions result ist wrong.
round(distance(Pos1.X, Pos2.X, Pos1.Y,Pos2.Y))[/code:1y391j78]
[code:1y391j78]round(sqrt(abs(Pos1.X - Pos2.X)^2 + abs(Pos1.Y - Pos2.Y)^2))[/code:1y391j78]
This - IMHO correct way to calculate the distance - gives a very different result using the distance expression.
[b]Operating System and Service Pack[/b]
[b]Construct 2 Version ID[/b]
Develop games in your browser. Powerful, performant & highly capable.
Not a bug.
The correct way to use the distance function is:
distance(Pos1.X, Pos1.Y, Pos2.X, Pos2.Y)[/code:1czenn2n]
Notice the x,y pairs are next to each other.
It's exactly the same as:
[code:1czenn2n]sqrt((Pos2.X - Pos1.X)^2 + (Pos2.Y - Pos1.Y)^2)[/code:1czenn2n]
[code:1czenn2n]sqrt((Pos1.X - Pos2.X)^2 + (Pos1.Y - Pos2.Y)^2)[/code:1czenn2n]
The abs() isn't needed since any number squared is always positive.
Ahh, my bad, sorry, sorry, sorry -> ashamed in the leftmost corner.... (the eyes, old eyes, small screen, high resolution )
Thanks R0J0hound. I'll try to delete or let this thread delete.