For Example
21111111111111111112
10000000000000000001 10000000000000000001 10000000000000000001 21111111111111111112 |
This would give you a perfectly square track
and four 90 degree corners.
0 - Nothing 1 - Road 2 - Corner |
The Problem.
The Solution
To generate a track you need only one thing, an array listing the order of the track segments.
For Example
A track like the one shown below could easily be made up of an array like;track[track_length]={1,1,1,1,1,1,2,2,3,3,1,1,3,3,3................1,2,2,2,2,1,1};
Section Types 1 = straight
2 = right hand bend
3 = left hand bendIf the track generation is implemented like a circular list then a track that will be made up of laps will be generated, otherwise a point to point track will be generated.
Advantages