Hallo
hab ein 2D ballerspiel angefangen
bin gerade soweit
http://www.materialordner.de/a1ppJ5zEwxYAwbdZyzYOlRgdQE2jecGe.html
(W,S,D ist steuerrung)
wie kann ich jetzt machen das der scheisst?
das ist mein source:
Public Class Form1
Dim key As Keys = Nothing
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
key = e.KeyCode
If (key = Keys.W) Then
PictureBox1.Top = PictureBox1.Top - 1
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 2
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 3
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 4
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 5
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 6
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 7
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 8
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 9
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 10
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 11
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 12
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 13
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 14
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 15
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 1
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 2
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 3
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 4
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 5
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 6
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 7
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 8
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 9
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 10
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 11
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 12
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 13
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 14
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 15
Sleep(100)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
ElseIf (key = Keys.D) Then
PictureBox1.Left = PictureBox1.Left + 3
ElseIf (key = Keys.A) Then
PictureBox1.Left = PictureBox1.Left - 3
End If
End Sub
End Class
hab ein 2D ballerspiel angefangen
bin gerade soweit
http://www.materialordner.de/a1ppJ5zEwxYAwbdZyzYOlRgdQE2jecGe.html
(W,S,D ist steuerrung)
wie kann ich jetzt machen das der scheisst?
das ist mein source:
Public Class Form1
Dim key As Keys = Nothing
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
key = e.KeyCode
If (key = Keys.W) Then
PictureBox1.Top = PictureBox1.Top - 1
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 2
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 3
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 4
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 5
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 6
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 7
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 8
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 9
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 10
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 11
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 12
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 13
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 14
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top - 15
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 1
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 2
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 3
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 4
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 5
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 6
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 7
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 8
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 9
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 10
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 11
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 12
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 13
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 14
Sleep(15)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Top = PictureBox1.Top + 15
Sleep(100)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
PictureBox1.Left = PictureBox1.Left + 1
Sleep(1)
ElseIf (key = Keys.D) Then
PictureBox1.Left = PictureBox1.Left + 3
ElseIf (key = Keys.A) Then
PictureBox1.Left = PictureBox1.Left - 3
End If
End Sub
End Class