Ich hatte sonst klassisch immer mit Keypress gearbeitet und mit timer
p.left +=2
hat auch super funktioniert nun wollte ich mich auch in paar anderen Controlls
mich versuchen.
Nur hab ich nicht wirklich Ahnung wie ich das am besten hand haben könnte
Hab auch schon einiges versucht mit mouse move event und
Mouse Position X,Y aller dings hat das nicht so gut funktioniert
Jetzt bin ich etwas am Grübeln ^^"
wäre nett wen mir das mal einer dabei helfen könnte oder zeigen könnte
Code:
Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
If MousePosition.X < MousePosition.Y Then
Player.Top += 2
ElseIf MousePosition.Y < MousePosition.X Then
Player.Top -= 2
End If
End Sub
End Class
eigenschafften bzw Axen das meine pic box sich nah rechts oder links bewegt je nah dem ob meine mouse nah links oder nah rechts geht , kann mir einer sagen wie ich die raus bekomme von der mouse ?
Hab schon mit einem Timer getestet und komme auf das ergebniss was ich haben will nur wie oben beschrieben fehlt mir die rechts und links axe
Code:
Private Sub MM_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MM.Tick
If MousePosition.X < MousePosition.Y Then
Player.Top += 2
ElseIf MousePosition.x > MousePosition.y Then
Player.Top -= 2
End If
End Sub
Code:
Private Sub MM_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MM.Tick
If MousePosition.Y > Player.Location.X + Player.Location.Y Then
Player.Top += 2
ElseIf MousePosition.y < Player.Location.x + Player.Location.y Then
Player.Top -= 2
ElseIf MousePosition.X > Player.Location.x + Player.Location.X Then
Player.Left -= 2
ElseIf MousePosition.X > Player.Location.Y + Player.Location.X Then
Player.Left += 2
End If
End Sub
Code:
Private Sub MM_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MM.Tick
If MousePosition.Y > Player.Location.Y Then
Player.Top += 2
Me.Text = 1
ElseIf MousePosition.Y < Player.Location.Y Then
Player.Top -= 2
Me.Text = 2
End If
If Player.Location.Y > MousePosition.X - Player.Location.Y Then
Player.Left -= 2
Me.Text = 3
ElseIf Player.Location.Y < MousePosition.X + Player.Location.Y Then
Player.Left += 2
Me.Text = 4
End If
End Sub
Code:
Dim YM As Integer
Dim XM As Integer
Private Sub MM_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MM.Tick
If YM = Player.Location.Y Then
ElseIf xm = Player.Location.X Then
Else
If YM > Player.Location.Y Then
Player.Top += 2
Me.Text = 1
ElseIf YM < Player.Location.Y Then
Player.Top -= 2
Me.Text = 2
End If
If Player.Location.Y > XM Then
Player.Left -= 2
Me.Text = 3
ElseIf Player.Location.Y < XM Then
Player.Left += 2
Me.Text = 4
End If
End If
End Sub
Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
YM = e.Y
XM = e.X
End Sub
Closed Quest






