r/visualbasic • u/herokid29 • 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
0
u/[deleted] Mar 18 '19
[deleted]