Game Development Reference
In-Depth Information
'Not moving? Side of the road please.
If desiredSpeed <= 0 Then
'Only signs have no speed.
NameTag.Visible = False
myLane = 0
End If
'Put the controls on the form.
Body.Parent = parent
HeadLights.Parent = parent
NameTag.Parent = parent
'Get their sizes right. (Note that the
'width of a vehicle is height on a control;
'our vehicles are sideways on the form.
Body.Height = VehicleWidth
HeadLights.Height = VehicleWidth \ 4
'The same way that vehicle length turns into
'control width.
Body.Width = length
HeadLights.Width = 2 * desiredSpeed
'Auto-size the name tag.
NameTag.Text = myName & ":" & desiredSpeed.ToString
NameTag.AutoSize = True
'Color them.
Body.BackColor = Color.White
HeadLights.BackColor = Color.Transparent
NameTag.BackColor = Color.Transparent
'Outline them or not.
Body.BorderStyle = BorderStyle.FixedSingle
HeadLights.BorderStyle = BorderStyle.FixedSingle
NameTag.BorderStyle = BorderStyle.None
'Tweaks for the body since it is a TextBox control.
Body.TextAlign = HorizontalAlignment.Center
Body.ReadOnly = True
'Put us on the map.
End Sub
Search Nedrilad ::

Custom Search