I am Making a cheesy Guitar Hero like program and wanted to make a simple method to make a new note here is my code so far it only makes one note move and then the rest made with makeR() stay in place b/c their timer doesn't control them
CODE
Public Class Form1
Dim x
Dim r(9999) As PictureBox
Dim track(9999) As Integer
Dim Timer(9999) As Timer
Dim wow = ""
Public Event Tick As EventHandler
Private Sub TimerEventProcessor(ByVal myObject As Object, _
ByVal myEventArgs As EventArgs)
r(track(x)).Top = r(track(x)).Top - 1
End Sub
Private Function makeR()
If x = 9999 Or wow = "wow" Then
x = x - 1
r(x) = New PictureBox
r(x).Image = My.Resources.n1
r(x).Visible = True
r(x).Top = 278
r(x).Width = 25
r(x).Height = 25
r(x).Left = 12
r(x).BringToFront()
Controls.Add(r(x))
track(x) = x
Timer(x) = New Timer
Timer(x).Interval = 10
AddHandler Timer(x).Tick, AddressOf TimerEventProcessor
Timer(x).Start()
wow = "wow"
Return 0
Else
r(x) = New PictureBox
r(x).Image = My.Resources.n1
r(x).Visible = True
r(x).Top = 278
r(x).Width = 25
r(x).Height = 25
r(x).Left = 12
r(x).BringToFront()
Controls.Add(r(x))
track(x) = x
Timer(x) = New Timer
Timer(x).Interval = 10
AddHandler Timer(x).Tick, AddressOf TimerEventProcessor
Timer(x).Start()
x = x + 1
Return 0
End If
End Function
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If e.KeyChar = "1" Then
If r(x).Bounds.IntersectsWith(red.Bounds) Then
MsgBox("Werx")
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
makeR()
makeR()
End Sub
End Class