detecting collisions with move handler

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
dgm
Posts: 8
Joined: Sat Nov 11, 2006 5:13 am

detecting collisions with move handler

Post by dgm » Tue Apr 14, 2009 1:53 am

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

grc
Posts: 13
Joined: Thu Apr 23, 2009 9:21 am

Post by grc » Thu Apr 23, 2009 12:08 pm

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!"

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

Post by malte » Thu Apr 23, 2009 1:09 pm

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

Post Reply