3 Replies - 242 Views - Last Post: 04 August 2019 - 11:31 AM Rate Topic: -----

#1 dimdim80   User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 105
  • Joined: 28-December 08

image collision when one image is on the same x axis with the second

Posted 04 August 2019 - 09:18 AM

Hello everyone,

my code is
pic4.Location = New Point(pic4.Location.X - 10, 658)
        If pic4.Location.X = Pic.Location.X Then
            MessageBox.Show("END")
        End If



It is supposed that when pic 4 which is moving automatic to the left is on piclocation then it shoud display the message end.
Unfortunately it bypasses and nothing happens.

Any idea?
Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: image collision when one image is on the same x axis with the second

#2 dimdim80   User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 105
  • Joined: 28-December 08

Re: image collision when one image is on the same x axis with the second

Posted 04 August 2019 - 09:56 AM

If pic4.Bounds.IntersectsWith(Pic.Bounds) Then
'MessageBox.Show("END")

Exit Sub



Solved!!! Thanks anyway!!!
Was This Post Helpful? 0
  • +
  • -

#3 dimdim80   User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 105
  • Joined: 28-December 08

Re: image collision when one image is on the same x axis with the second

Posted 04 August 2019 - 10:39 AM

Well i am facing another problem now which requires a bit help.
in the same program
i would like when the mouseclick is pressed to assign a value attack=true and when it is not released to turn false.


    Private Sub TextBox1_KeyPress(sender As Object, e As MouseEventArgs) Handles MyBase.MouseClick

        If e.Button = Windows.Forms.MouseButtons.Left Then
            Timer1.Enabled = True
            Timer1.Start()
            imagecount= 6
            Timer6.Start()
            Timer5.Start()

            attack = True
else
attack=false




        End If

         


    End Sub



Unfortunately it does not work

This post has been edited by dimdim80: 04 August 2019 - 10:40 AM

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,197
  • Joined: 12-June 08

Re: image collision when one image is on the same x axis with the second

Posted 04 August 2019 - 11:31 AM

Question - why do you have an event method 'TextBox1_KeyPress' that is ' Handles MyBase.MouseClick'?

In the designer, right click your form -> properties. In the properties window click the lightening bolt. You should see all available events for that specific UI object. If you sort by name you can scroll to the 'mouse' events. One being 'down' and one being 'up' maybe a better option than the whole circuit that is 'click'.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1