Hey guys, what i've been wanting my program to do is for the countdown to reduce time by 10 seconds when the melon hits the rope however, no matter how many different positions and variations i use with the code, even when the melons have vanished (through being hit by another picture) the picture i'm assuming is still travelling and hitting the ropes and reducing 10 seconds, even when it has vanished!? Would really appreciate it if someone could show me where i've done wrong.

Private Sub tmrMelon_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMelon.Tick
        If PicMelon.Left >= Me.Width Then
            PicMelon.Left = 0 - PicMelon.Width
        Else
            PicMelon.Left = PicMelon.Left + 5
        End If

        If PicMelon.Bounds.IntersectsWith(picPunch.Bounds) Then
            PicMelon.Hide()
            PicMelon.Enabled = False
        End If

    End Sub

Private Sub tmrTime_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrTime.Tick
        Dim reply As Integer
        txtTimer.Text = mytime - 1
        mytime = txtTimer.Text

        If mytime <= 0 Then
            tmrTime.Enabled = False
            tmrMelon.Stop()
            tmrPunch.Stop()
            tmrTime.Stop()
            reply = MsgBox("Game Over. Would you like to try again?", vbYesNo)



            If reply = vbYes Then
                Play.Show()
                Me.Close()
            Else
                Form1.Show()
                Me.Close()
            End If
        End If

        If PicMelon.Bounds.IntersectsWith(picRopes.Bounds) Then
            mytime -= 10
            txtTimer.Text = mytime
            PicMelon.Enabled = False
        End If

Thank you for reading :)

regards

Griff

No problem people, fixed :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.