I'm not asking about the graphics part, though. What I'm wondering about is how to store the track.
The best idea I've come up with so far is maybe to consider the track as segments and then have each segment attributes which correspond to the degree that it goes left/right or up/down, plus the length in meters. Then store all those as a big list. So a track like:
Code: Select all
{
{x: 0, y: 0, l: 20},
{x: 10, y: 0, l: 35},
{x: 0, y: 0, l: 10},
{x: 0, y: -10, l:10},
…
}
The other approach I've thought up is having some sort of equation which will draw a line in 3D space. This would allow for more flexibility and not have to break the track into segments which might allow for smoother "transitions" between parts of track, but this sort of math is probably out of my league.
I'm really curious what the games of the era did. However, I haven't been able to find any articles which cover it despite trying several different search phrases. If anyone has any links covering this I'd greatly appreciate it.
Otherwise I'd appreciate any feedback on how you'd implement this sort of thing or what flaws or improvements you might be able to see in my "big list" approach as above.