Public Class Form1 Shared random As New Random() Dim missiles(19) As PictureBox Dim X1, Y1 As Integer Dim score As Integer = 0 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load scoreofftxt.Text = score Dim nl As PictureBox For x = 0 To 9 For y = 0 To 1 Dim i As Integer For i = 0 To 5 X1 = random.Next(10, 810) Next Dim ib As Integer For ib = 0 To 5 Y1 = random.Next(-800, 0) Next nl = New PictureBox nl.Width = 25 nl.Height = 45 nl.Left = X1 nl.Top = Y1 Controls.Add(nl) nl.Image = example.Image nl.BackgroundImage = My.Resources.BGTK nl.SizeMode = PictureBoxSizeMode.StretchImage missiles(y * 10 + x) = nl nl.BringToFront() Next Next End Sub Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.A a.Enabled = True d.stop() Case Keys.D a.Stop() d.enabled = True End Select End Sub Private Sub a_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles a.Tick paddle.Left = paddle.Left - 10 End Sub Private Sub d_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles d.Tick paddle.Left = paddle.Left + 10 End Sub Private Sub bomb_timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bomb_timer.Tick For i = 0 To 19 missiles(i).Top = missiles(i).Top + 10 Next If score = 19 Then bomb_timer.Stop() a.Stop() d.Stop() Dim RD = MsgBox("A Bomb has exploded!", MsgBoxStyle.OkOnly, "DEAD") If RD = MsgBoxResult.Ok Then Close() End If For i = 0 To 19 If missiles(i).Visible = True And missiles(i).Bounds.IntersectsWith(paddle.Bounds) Then missiles(i).Visible = False score = score + 1 ElseIf missiles(i).Visible = True And missiles(i).Top >= 710 Then bomb_timer.Stop() a.Stop() d.Stop() explosion.BringToFront() explosion.Visible = True Dim RD = MsgBox("A Bomb has exploded!", MsgBoxStyle.OkOnly, "DEAD") If RD = MsgBoxResult.Ok Then Close() End If Next End Sub End Class