Hello,

This is actually not really a question about vb, but about how to make a code.
I'm making a RPG game and I want to make my character have "normal" movement. The problem is actually when I just hold down one of my movement keys (a, s, d, w) my character will jump out of the screen because it's going to fast.

My question: How can I make the code so my character will move when I hold down one of the movement buttons(a, s, w, d), but without that the character is going so fast that it's jumping out of the screen?

here is my movement sub:
Code:
    Private Sub frmMain_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

        'MOVEMENT'
        If e.KeyCode = Keys.A Then
            If P(MyIndex).Dir = DIR_LEFT Then
                P(MyIndex).X = P(MyIndex).X - 1
            Else
                P(MyIndex).Dir = DIR_LEFT
            End If
        End If

            If e.KeyCode = Keys.D Then
                If P(MyIndex).Dir = DIR_RIGHT Then
                    P(MyIndex).X = P(MyIndex).X + 1
                Else
                    P(MyIndex).Dir = DIR_RIGHT
                End If
            End If

            If e.KeyCode = Keys.S Then
                If P(MyIndex).Dir = DIR_DOWN Then
                    P(MyIndex).Y = P(MyIndex).Y + 1
                Else
                    P(MyIndex).Dir = DIR_DOWN
                End If
            End If

            If e.KeyCode = Keys.W Then
                If P(MyIndex).Dir = DIR_UP Then
                    P(MyIndex).Y = P(MyIndex).Y - 1
                Else
                    P(MyIndex).Dir = DIR_UP
                End If
            End If

    End Sub