I'm trying to make a simple function that plots a person on a grid (the
form) and then moves them 5 feet (5 pixels) in the desired direction
(degree).
I can make the object (my person) and give it a direction, but I can't
get it to actually follow that direction for only the desired 5 pixels.
Example: the user selected 320 degrees to move the person 5 feet NW
1st frame
----------------------------
| |
| |
| \ |
| o |
| 320 |
| |
| |
----------------------------
2nd frame
----------------------------
| |
| \ |
| o |
| |
| 320 |
| |
| |
----------------------------
I'm currently trying math functions to find the slope, y-intercept, etc
of the triangle that is formed from the start point, angle and the new X
location (old position + 5 feet) to find my new Y. This doesn't work as
the angle nears an axis (90, 180, 270, 360) and either grows to large or
goes to zero, moving my person 0 or an infinite number of pixels.
Any ideas?