Robust spot system and irritating bugs

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.recievers only have 2 spots

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.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s