No collision

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

No collision

Post by JosepM » Mon Dec 27, 2010 11:46 pm

Hi Malte,

I follow the example of imageCollision but I not get collision :cry:

First I set the constrainRectagular in the messagebox for both images.

Work with buttons? and how to check with multiple images at same time?

What I doing wrong?

on mousedown
grab me
end mousedown

on constrainRectangularCallback

if imageCollide(the name of img "ghost_b",the name of img "ghost_c",0) then
put "Collision detected" into fld "imgCollide"
else
put "No collision" into fld "imgCollide"
end if
end constrainRectangularCallback

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: No collision

Post by malte » Tue Dec 28, 2010 12:22 pm

Hi Josep,

imageCollide works with images, not buttons.
Are you sure the two images you reference exist? Do they really collide when you move them?
Also if you grab an object, constrainRectangularCallback is not sent. It is only sent if you are moving an object that has its constrainRectangular property set.

Hth,

Malte

Post Reply

Return to “Animation Engine”