一个图片由上向下移动 中间有一个image会移动,怎么判断上面的图片和image碰见的那一时刻
谢谢

解决方案 »

  1.   

    if (Picture1.Top+Picture1.Height)=Image1.Top then
      

  2.   

    这样我试了不可以,我说的意思是: 从上面掉下一个球,下面有一个小人,用键盘控制,怎么判断球撞上了人(人和球用:image2,image1表示),谢谢!
      

  3.   

    'image1 球
    'image2 人
    if (image1.left+image1.width)>=image2.left and image1.left<=(image2.left+image2.width) and (image1.top+image1.heigth)>=image2.top then
      

  4.   

    'image1 球
    'image2 人
    刚才代码有误,height写错了
    If (Image1.Left + Image1.Width) >= Image2.Left And Image1.Left <= (Image2.Left + Image2.Width) And (Image1.Top + Image1.Height) >= Image2.Top Then
      

  5.   

    Private Sub Command1_Click()
    'Image2是球,Image1是人
    If Image2.Top + Image2.Height > Image1.Top Then
        If Image2.Left + Image2.Width > Image1.Left And Image2.Left - Image1.Left < Image1.Width Then
            MsgBox "砸中了"
        End If
    End If
    End Sub
      

  6.   

    谢谢programfish(programfish) 和  tztz520(午夜逛街)回复,我拷贝了以后。 tztz520(午夜逛街)你的代码是对的,谢谢您!