I started working on actually writing Cruiser City for Heroes Unlimited. I got as far as the commercial sector when I wanted to work on the race track design for a superspeedway that will be depicted in the book. Compared to Cruiser City's map (last blog post), this one was a bit more difficult. I had to figure out how Arcs worked and figure out a way to line them up to the back and front stretch. The front stretch is a reverse dog leg while the pit lane on the back stretch. The track in the book has a track inside for Formula 1 and GRAND AM racing, but it is not depicted on the map (that would be way too difficult/time consuming)
So here is the code:
Dim blackPen As New Drawing.Pen(Color.Black, 3)
e.Graphics.DrawLine(blackPen, 200, 100, 750, 100) 'backstretch
e.Graphics.DrawLine(blackPen, 200, 300, 300, 300) 'off turn 4
e.Graphics.DrawLine(blackPen, 300, 300, 400, 250) 'dog leg start /
e.Graphics.DrawLine(blackPen, 750, 300, 650, 300) 'into turn 1
e.Graphics.DrawLine(blackPen, 650, 300, 550, 250) 'dog leg exit \
e.Graphics.DrawLine(blackPen, 400, 250, 550, 250) 'dog leg
e.Graphics.DrawLine(blackPen, 250, 100, 255, 105) 'pit road exit
e.Graphics.DrawLine(blackPen, 255, 105, 695, 105) 'pit road
e.Graphics.DrawLine(blackPen, 695, 105, 700, 100) 'pit road entrance
e.Graphics.DrawLine(blackPen, 475, 245, 475, 255) 'start/finish line
e.Graphics.DrawArc(blackPen, 75, 100, 250, 200, 90, 180) 'turns 3 and 4
e.Graphics.DrawArc(blackPen, 610, 100, 250, 200, -90, 180) 'turns 4 and 5
And here is the result:
Formula 1 racing only starts by turning right on the first turn. Since the start is technically a right-turn off the dog-leg, I wonder if Formula 1 would drive the entire oval.
No comments:
Post a Comment