Page 1 of 1

detecting collisions with move handler

Posted: Tue Apr 14, 2009 1:53 am
by dgm
Hi, I need some help. I have a brick that is falling downwards (move command) and I want to shoot a bullet up from the bottom of the screen to intercept the falling brick. I can get the brick to fall and the bullet to shoot upwards (also a move command) simultaneously but I can't figure out how to detect whether they have collided or not. While the move handler is running I don't know how to check for an intersect.

Dennis

Posted: Thu Apr 23, 2009 12:08 pm
by grc
Heres an idea. Think it will work.

Code: Select all

if the location of image "Bullet" is within the rect of image "Brick" then answer "Hit!"

Posted: Thu Apr 23, 2009 1:09 pm
by malte
I know this will not be much help, but this is exactly one of the tasks why I wrote animationEngine. The build in move command is "a tad bit underfeatured" (to avoid saying it is almost useless in a game context)

All the best,

Malte