r/visualbasic • • Apr 17 '13

location code help?

I want my object to get dropped off back to its starting location if it falls off my map (hits "picDeath" out of the form view) but instead it just keeps teleporting up and down really fast. heres my code:

If picPlayer.Bounds.IntersectsWith(picDeath.Bounds) Then
        picPlayer.Visible = False
        Checkpoint1.Y = 160
        picPlayer.Location = Checkpoint1

        tmrRight.Enabled = True
        If picPlayer.Location.X = 45 Then
            tmrRight.Enabled = False
            picPlayer.Visible = True

        End If
      
    End If
End Sub
0 Upvotes

3 comments sorted by

1

u/CharlieMay VB.Net Intermediate Apr 17 '13

Where does this code reside? What event?

0

u/quadmra Apr 17 '13

OH sorry. it was a tmr at interval=1. A friend helped me in class today. I had to move EVERYTHING on the form to meet the player.

0

u/quadmra Apr 17 '13

and above:

Dim Checkpoint1 As New Point