How to get XY coordinate with distance and angle.

2

Stats

5,973 visits, 9,323 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 6 Mar, 2013. Last updated 19 Feb, 2019

If you have used GameMaker, you might know this as lengthdir_x,y. This isn't available in Construct, but really its just a simple formula. For that reason, this tutorial will contend with being one of the shortest out there.

I recommend making a function with the following ACE:

What this calculates is the relative X or Y coordinates based on only the knowledge of how far and at what angle the point is. Add the returning number to your objects X or Y value to get the proper coordinates of your target.

  • 0 Comments

Want to leave a comment? Login or Register an account!