by Mike dugger, and class (1 Submission)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 12th May 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
detects collision between two images
dim collided as integer
' a = image1 name
' b = image2 name
function collided (a as image,b as image) as integer
dim AcenterX as integer
dim AcenterY as integer
dim BCenterX as integer
dim BcenterY as integer
ACenterX = a.top
AcenterY = a.height
bcenterX = B.top
BCentery = B.height
collided = false
if abs(AcenterX - bcenterx) = 0 then
if abs(AcenterY - bcenterY) = 0 then
collided = true
end if
end if
end function