Closed ikbensiep closed 5 months ago
I'm thinking of calculating the 3 sectors purely by dividing the waypoints the code finds along the racetrack path:
sector 1 starts at waypoints[0]
and ends at waypoints[waypoints.length / 3]
sector 2 starts at waypoints[(waypoints.length / 3)]
and ends at waypoints[waypoints.length - (waypoints.length / 3)]
sector 3 starts at waypoints[waypoints.length - (waypoints.length / 3)] and ends at
waypoints[0]`.
with some appropriate Math.floor()
ing here and there.
Additionally, by keeping track of waypoints we know in which sector the player is in currently so that when they go off track we can throw yellow flags along with the sector the yellow flag is shown in.
This could be done by adding separate sector
<path>
s or by repurposing the waypoints found inpath#racetrack
.Discuss.