So I decided to improve the pathing system like I said I would yesterday. Each player has an incrementor called curSpot. curSpot controls where the player goes next (maybe should be called curActiveSpot or nextSpot?). Anyway, when the user gets within a small radius of their current target spot, we increment curSpot so they now target the next spot. The system works beautifully and I love the elegance of it.
I did have one hugely irritating bug. The recievers slant routes weren’t working. I spent a long time looking for this and long story short: I made the simple mistake of not allowing for the reciever to be on the spot exactly. In other words, I checked if they were just a little past or a little short in the y-axis, and if yes then I checked if they were a little past or a little short in the x axis. If both were true I returned true and then incremented the curSpot variable. Problem was, I never checked if the reciever was perfectly on the spot. This will always fail, since the first x spot is exactly the same as the recievers starting x spot(since they run x yards forward and then cut). 8 simple >= or <= solved the problem.
I do have one funny bug though. Since I only have two spots actually filled in, once they hit the second spot they go wherever they want. Curiously though, they don’t go in random directions, every time they go in the same crazy directions.
You can see the recievers wandering around at the edge of the field. I don’t have any logic preventing them from going off the field, but they always turn away from the edge. I especially like the cornerbacks, who are faithfully covering them right now.