Public Class Form1 Private Sub moveSentry() If sentry.Tag = "down" Then sentry.Location = New Point(sentry.Location.X, sentry.Location.Y + 2) End If If sentry.Tag = "up" Then sentry.Location = New Point(sentry.Location.X, sentry.Location.Y - 2) End If If sentry.Tag = "right" Then sentry.Location = New Point(sentry.Location.X + 2, sentry.Location.Y) End If If sentry.Tag = "left" Then sentry.Location = New Point(sentry.Location.X - 2, sentry.Location.Y) End If End Sub Private Sub checkCorners() If sentry.Location.X = 0 And sentry.Location.Y = 0 Then sentry.Tag = "down" sentry.Image = Image.FromFile("down1.png") End If If sentry.Location.X = 0 And sentry.Location.Y = 202 Then sentry.Tag = "right" sentry.Image = Image.FromFile("right1.png") End If If sentry.Location.X = 218 And sentry.Location.Y = 202 Then sentry.Tag = "up" sentry.Image = Image.FromFile("up1.png") End If If sentry.Location.X = 218 And sentry.Location.Y = 0 Then sentry.Tag = "left" sentry.Image = Image.FromFile("left1.png") End If End Sub Private Sub sentryTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sentryTimer.Tick moveSentry() checkCorners() End Sub End Class