Public Class Form1 Dim walls(9) As Label Dim lName As String Dim x As Integer Dim heroDir As String Public Sub PutWallsInArray() For x = 1 To walls.Length - 1 lName = "Label" & (x) 'This is the name of your wall labels. Make sure you don't have any gaps walls(x) = New Label walls(x) = DirectCast(Me.Controls.Find(lName, True)(0), Label) ' walls(x).Text = "My name is " & x Controls.Add(walls(x)) ' walls(x).Size = New Size(25, 25) ' walls(x).Location = New Point(25, x * 30) Next End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load MsgBox(walls.Length) PutWallsInArray() End Sub Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Up Then Hero.Location = New Point(Hero.Location.X, Hero.Location.Y - 5) heroDir = "up" End If If e.KeyCode = Keys.Down Then Hero.Location = New Point(Hero.Location.X, Hero.Location.Y + 5) heroDir = "down" End If If e.KeyCode = Keys.Left Then Hero.Location = New Point(Hero.Location.X - 5, Hero.Location.Y) heroDir = "left" End If If e.KeyCode = Keys.Right Then Hero.Location = New Point(Hero.Location.X + 5, Hero.Location.Y) heroDir = "right" End If checkWallCollisions() End Sub Public Sub checkWallCollisions() For Me.x = 1 To walls.Length - 1 If Hero.Bounds.IntersectsWith(walls(x).Bounds) Then moveHeroBack() End If Next End Sub Public Sub moveHeroBack() If heroDir = "up" Then Hero.Location = New Point(Hero.Location.X, Hero.Location.Y + 5) If heroDir = "down" Then Hero.Location = New Point(Hero.Location.X, Hero.Location.Y - 5) If heroDir = "left" Then Hero.Location = New Point(Hero.Location.X + 5, Hero.Location.Y) If heroDir = "right" Then Hero.Location = New Point(Hero.Location.X - 5, Hero.Location.Y) End Sub End Class