KillSaw
New member
Basically my problem here is that I want two people to be able to move two picboxes at the same time using one keyboard.
What's happening at the moment is that if one is moving and the key to move the other box is pressed, it will lock out the first box from moving.
Go1 and Go2 hold the actual movement code, but I'm pretty sure that wouldn't have any effect on this.
What's happening at the moment is that if one is moving and the key to move the other box is pressed, it will lock out the first box from moving.
VB.NET:
Private Sub PaddleRight(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Up Then
firstvalue = 1
ElseIf e.KeyCode = Keys.Down Then
firstvalue = 2
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Timer2.Interval = 1
If firstvalue = 1 Then
Go2(0, -4)
ElseIf firstvalue = 2 Then
Go2(0, 4)
ElseIf firstvalue = 3 Then
Go1(0, -4)
ElseIf firstvalue = 4 Then
Go1(0, 4)
End If
End Sub
Private Sub PaddleRightStop(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
If e.KeyCode = Keys.Up Then
firstvalue = 0
ElseIf e.KeyCode = Keys.Down Then
firstvalue = 0
End If
End Sub
Private Sub PaddleLeft(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.W Then
firstvalue = 3
ElseIf e.KeyCode = Keys.S Then
firstvalue = 4
End If
End Sub
Private Sub PaddleLeftStop(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
If e.KeyCode = Keys.W Then
firstvalue = 0
ElseIf e.KeyCode = Keys.S Then
firstvalue = 0
End If
End Sub
Go1 and Go2 hold the actual movement code, but I'm pretty sure that wouldn't have any effect on this.