• 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 Inputting coordinates in polar vs orthographic

D

Darkwing

Guest
Is there any way to provide position data to GML in polar coordinates instead of x and y? My current code only works if the player is facing directly up, down, left, or right, due to only checking x+32 etc... is there a way to say like "32 at direction + 90 degrees" or something like that?

Thanks!
 
Last edited by a moderator:

Nidoking

Member
Well, if you're using polar coordinates, I assume you know at least some trigonometry. The lengthdir_x and lengthdir_y functions should be shortcuts for that.
 
D

Darkwing

Guest
Well, if you're using polar coordinates, I assume you know at least some trigonometry. The lengthdir_x and lengthdir_y functions should be shortcuts for that.
This is EXACTLY what I was looking for! Thank you!
 

chamaeleon

Member
Well, if you're using polar coordinates, I assume you know at least some trigonometry. The lengthdir_x and lengthdir_y functions should be shortcuts for that.
Is it really a shortcut if using the trig functions means typing less characters in total? :)
 
Top