Hey so I just wanted to start making a simple 2D game, but I can't figure out how to make the character move! Yeah I know I'm pretty dumb but can you bear with me here? Thanks.
So I want to make the character move with WASD. My problem is that when I press a key, nothing happens. Nothing at all. What am I doing wrong? Thanks for the help in advance.
Code:Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.W Then Player.Top = Player.Top - 10 Label1.Text = "W" End If If e.KeyCode = Keys.A Then Player.Left = Player.Left - 10 Label1.Text = "A" End If If e.KeyCode = Keys.S Then Player.Top = Player.Top + 10 Label1.Text = "S" End If If e.KeyCode = Keys.D Then Player.Left = Player.Left + 10 Label1.Text = "D" End If End Sub


Reply With Quote

