如何在蛇游戏中使蛇更快地移动?

时间:2019-04-04 12:17:27

标签: vb.net

我想让蛇吃掉后更快地移动,例如10条“老鼠”。我该怎么办?或者代码中的问题出在哪里?

Private Sub snake_Moves_Faster()

    If lenghtofsn = lenghtofsn + 10 Then

        tm_SnakeMover.Interval = tm_SnakeMover.Interval - 5

    End If

End Sub

Private Sub tm_SnakeMover_Tick(sender As Object, e As EventArgs) Handles tm_SnakeMover.Tick

    For i = lenghtofsn To 1 Step -1
        snake(i).Top = snake(i - 1).Top
        snake(i).Left = snake(i - 1).Left
    Next

    Label2.Text = ("0")
    If snake(0).Bounds.IntersectsWith(mouse.Bounds) Then
        Label2.Text = CStr(CInt(Label2.Text)) + 1
    End If
    collideWithMouse()
    snake(0).Top += udMover
    snake(0).Left += lrMover
    Collide_with_walls()
    snake_Moves_Faster()
End Sub

0 个答案:

没有答案