1 Attachment(s)
[RESOLVED] Moving A PictureBox To A Certain Location - Help
Attachment 97525
The PictureBox I'm talking about is the Ball,
And There Is A Horizontal PowerPack Line Moving Down From The Top of the Goal,
and A Vertical PowerPack Line Moving To The Right From The Left of the Goal,
and I'd like to move the Ball to the Location/Point of Intersection of those two lines,
how will I move the ball?
Because I tried using,
picBall.Left -= Int(PowerBar.Value / 2)
picBall.Top -= Int(PowerBar.Value / 2)
If picBall.Left <= LineShape1.Y2 / 2 And picBall.Right <= LineShape2.X2 / 2 Then
Shoot.Enabled = False
Me.Refresh()
End If
I still don't have the codes on how to get the Intersection, and the "Shoot.Enabled = False" is to stop the ball from moving, the problem is if I use picBall.Left and picBall.Top, it's always moving to the left side, any other ideas?
Re: Moving A PictureBox To A Certain Location - Help
A horizontal line runs from hx1,hy1 to hx2,hy1 and a vertical line runs from vx1,vy1 to vx1, vy2 so the intersection point is vx1, hy1.
1 Attachment(s)
Re: Moving A PictureBox To A Certain Location - Help
So I had to assign variables in each point, Is your formula for the intersection point, also gets the intersection even the intersection is not in the center?
For example this one:
Attachment 97551
what is the exact code on how to get this, because I don't really understand the codes I've found on the Internet.
do I still have to use, picBall.Left and picBall.Top to move the picture box?
Re: Moving A PictureBox To A Certain Location - Help
I also want to use the PowerBar on the Bottom-Right Corner to be the basis of the picturebox's movement speed to the location, also called as "Shot Power", so If I'm gonna use New Point, my PowerBar will be useless, I need another code for that, please help, thank you for the post.