Game Development Reference
In-Depth Information
#End Region
Private Sub Road_Load(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles MyBase.Load
'Keep this list in sorted X order, ascending.
'(length, desired speed, parent, X pos, initial speed, name)
'The barely subsonic vehicle for crash testing (250 is a
'more realistic top speed).
ToyBox.Add(New Vehicle(35, 600, Me, -3025, 50, "F1+"))
'To get serious speed differences.
ToyBox.Add(New Vehicle(35, 180, Me, -1025, 50, "Exotic"))
'Various fast bikes.
ToyBox.Add(New Vehicle(30, 95, Me, -605, 50, "Bike F"))
ToyBox.Add(New Vehicle(30, 90, Me, -545, 50, "Bike E"))
ToyBox.Add(New Vehicle(30, 85, Me, -485, 50, "Bike D"))
'Also shows good speed differences.
ToyBox.Add(New Vehicle(35, 120, Me, -425, 50, "Sport"))
ToyBox.Add(New Vehicle(30, 80, Me, -365, 50, "Bike C"))
'These five make good initial test vehicles.
ToyBox.Add(New Vehicle(30, 75, Me, -305, 50, "Bike B"))
ToyBox.Add(New Vehicle(45, 60, Me, -240, 50, "Coupe"))
ToyBox.Add(New Vehicle(200, 50, Me, 0, 50, "Truck"))
ToyBox.Add(New Vehicle(45, 60, Me, 70, 50, "Sedan"))
ToyBox.Add(New Vehicle(30, 80, Me, 120, 50, "Bike A"))
'A two-truck slow pass up ahead.
ToyBox.Add(New Vehicle(200, 55, Me, 1000, 50, "Truck"))
ToyBox.Add(New Vehicle(200, 50, Me, 1400, 50, "Truck"))
End Sub
Now we are ready to test. We have created numerous vehicles with widely varying
capabilities. (Feel free to comment out vehicles to make things simpler as you
debug your code.) We keep all of the vehicles in the toy box so that we have them
in one convenient place. We keep the toy box sorted so that the AI and collision
detection can run a great deal faster. If a given vehicle is not hitting the vehicle
Search Nedrilad ::

Custom Search