Quote: |
Another option is to draw a polyline of the course, and find the player's shortest normal to that line. You then know his position on the line, and the line's total length. You now know how far he is in the course and how much is left. |
Quote: |
or add some checkpoints every 20? tiles and the first person to cross it gets position 1 2nd person gets pos 2 etc etc. |
Samapico wrote: |
How would you exactly 'draw a polyline' ? You need like... an array of points or something ?.o |
Code: Show/Hide struct Point
{ int x, y; //Obviously the X/Y coords of the point char name[50]; //The name of this section of the course int distance; //The sum of all previous lines (so don't need to recalc) }; |
Samapico wrote: |
thanks, that gave me some more ideas |