Hi i am making an RPG game with visual basic...
The character is a picture box.
The problem is when i move the charactor with the arrow keys it flashes black for a milisecond. I think added animated walking where it slowely moves 32 pixels but not it goes black the whole time... what can i do sto stop it going black everytime it moves?
Old movement code:
that code moved player or jumped player to a tile 32 pixels in one direction and caused a quick black flash
That code moves the player slowely but causes a big black line to merge then just ends up teleporting the player...
How can i get rid of the black flash during movement?
The character is a picture box.
The problem is when i move the charactor with the arrow keys it flashes black for a milisecond. I think added animated walking where it slowely moves 32 pixels but not it goes black the whole time... what can i do sto stop it going black everytime it moves?
Old movement code:
VB.NET:
If e.KeyCode = Keys.Right Then
player.Image = My.Resources.mainplayerright
moveto = New Point(playerx + 32, playery)
If badpoints.Contains(moveto) Then
Else
playerx = playerx + 32
player.Location = New Point(playerx, playery)
End If
End If
that code moved player or jumped player to a tile 32 pixels in one direction and caused a quick black flash
VB.NET:
If e.KeyCode = Keys.Left Then
player.Image = My.Resources.mainplayerleft
moveto = New Point(playerx - 32, playery)
If badpoints.Contains(moveto) Then
Else
walkdirection = "left"
walkmove.Start()
End If
End If
Private Sub walk_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles walkmove.Tick
If walkdirection = "left" Then
While walkcount < 32
playerx = playerx - 1
player.Location = New Point(playerx, playery)
walkcount = walkcount + 1
End While
walkcount = 0
walkmove.Stop()
End If
End Sub
That code moves the player slowely but causes a big black line to merge then just ends up teleporting the player...
How can i get rid of the black flash during movement?