目前我正在开发一款游戏,我希望让这辆车慢慢完全停下来,而不是在放开钥匙后立即停下来。当前的移动代码如下。
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As System.Windows.Forms.Keys) As Short
Private Sub MovementTimer_Tick(sender As Object, e As EventArgs) Handles MovementTimer.Tick
If GetAsyncKeyState(Keys.Up) <> 0 Then
Car.Top -= 6
End If
If GetAsyncKeyState(Keys.Down) <> 0 Then
Car.Top += 6
End If
End Sub
我需要添加或更改哪些内容?