I am coding a game where the player's position is stored in co-ordinates, and they can move in any direction by moving their mouse in it (eg. $129$ degrees), and I need a way to convert that number to co-ordinates to add.
- $0°$ would be $(0, 1)$, as they are going up $1$ and not moving right at all.
- $45°$ would be $(1, 1)$, as they are moving up $1$ and right $1$*.
- $135°$ would be something like $(1, -1)$ as they are moving $1$ down and $1$ right*.
*Not moving a full square, as it would be a circular rotation, so it would actually be something like $0.5$.
So something like this (which is quite easy in scratch as it is graphical): https://scratch.mit.edu/projects/284120140/