r/visualbasic • • Mar 18 '19

Space Invaders issue

I am creating a space invaders game and I am having trouble with the invaders going faster. When they die and come back, they start going faster,but after a while they stop abruptly. They don't move. Can someone help me figure out what to do?

Private Sub skullmovement()

        If PictureBox1.Left >= 5 And border = True Then

            For i As Integer = 1 To 20

                pic(i).Left += fast

            Next

            If PictureBox1.Left > (Me.Width - 550) Then

                border = False

                For i As Integer = 1 To 20

                    pic(i).Top += 20

                Next

            End If

        ElseIf PictureBox1.Left < (Me.Width - 500) And border = False Then

            For i As Integer = 1 To 20

                pic(i).Left -= fast

            Next

            If PictureBox1.Left < 10 Then

                border = True

                For i As Integer = 1 To 20

                    pic(i).Top += 20

                Next

            End If

        End If

        For i As Integer = 1 To 20

            If pic(i).Bounds.IntersectsWith(picbshooter.Bounds) And picbshooter.Visible = True And pic(i).Visible = True Then

                skulltimer.Stop()

                lbldead.Visible = True

                lives -= 1

            End If

        Next

        If num = 20 Then

            For i As Integer = 1 To 20

                pic(i).Visible = True

                skulltimer.Stop()

                skulltimer.Start()

                item = 1

                num = 0

            Next

            fast += 5

        End If

    End Sub

6 Upvotes

2 comments sorted by

0

u/[deleted] Mar 18 '19

[deleted]

2

u/herokid29 Mar 18 '19

How would I do that?

3

u/cuddleslapine VB.Net Intermediate Mar 19 '19

Click on the margin of your document where you want to place a break point. There will be a red point at that line. Next time you run the program, it will stop at that line, and you can inspect the variables and such, and you can advance manually by dragging that arrow around.