Groups and collisions

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

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
asayd
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 107
Joined: Mon Apr 10, 2006 7:02 pm
Location: Provo, Utah, USA
Contact:

Groups and collisions

Post by asayd » Tue May 22, 2012 11:53 pm

I'm trying to detect collisions with objects in a group and I have two problems:
1. When I try to move the group around, it moves only one object in the group, the one I click down on. The group consists of two buttons, each with an icon assigned. I need the group to move as a single unit.
2. I actually only want collisions to be detected on one of the objects in the group. Is this possible?

Regards,
Devin Asay
Devin Asay
Learn to code with LiveCode University
https://livecode.com/store/education/

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

Re: Groups and collisions

Post by malte » Thu May 24, 2012 7:39 am

Hi Devin,

1) Is a little tricky (I still need to set up a demo stack for that), as the group only receives the relevant messages if it is opaque. Demo stack will follow during the course of next week.

2) is a lot simpler. If you set up the collision listener, do not make the group listen for collisions, but instead the object contained in the group.

Hope that helps,

Malte

asayd
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 107
Joined: Mon Apr 10, 2006 7:02 pm
Location: Provo, Utah, USA
Contact:

Re: Groups and collisions

Post by asayd » Thu May 24, 2012 9:16 pm

Thanks for the reply, Malte. I still couldn't get the group to move, but decided it was easier just to use more traditional methods (mouseDown, mouseMove handlers) to control the dragging. I was able to listen for collisions on a single object in the group, just as you suggested.

Devin
Devin Asay
Learn to code with LiveCode University
https://livecode.com/store/education/

Post Reply

Return to “Animation Engine”