Been writing some code to let my sprites find their way around a track on screen. At present I'm using a color-coded bitmap, but as an alternative I'd like to try and write a waypoint based AI.
I plan to store say 32 waypoints in an array.
I assume I'd take the first 3 points in the array and plot a smooth curve through them.
After the sprite passes the 1st point, I'd load the 4th point in and plot a smooth curve through points 2, 3 & 4 - and so on all around the track.
Is there any sample code kicking around ?
I plan to store say 32 waypoints in an array.
I assume I'd take the first 3 points in the array and plot a smooth curve through them.
After the sprite passes the 1st point, I'd load the 4th point in and plot a smooth curve through points 2, 3 & 4 - and so on all around the track.
Is there any sample code kicking around ?