aeCollision

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

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
Bjoern
Posts: 7
Joined: Mon Nov 07, 2011 9:41 pm

aeCollision

Post by Bjoern » Mon Nov 14, 2011 10:36 pm

Hi Malte,

I got a new question ;-)

I am trying to build a small tower defense game, and would like to listen to collisions between multiple towers with mulitple targets.
With only one target it is working just fine but the second one is giving me a headache.
aeListenForCollisionsWith only seems to accept one target.

If this is not possible I guess I have to stop all movement, check for collisions by and then continue the movement.

Cheers,
Björn

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

Re: aeCollision

Post by malte » Tue Nov 15, 2011 7:27 am

Hi Björn,

could you be more specific on what you need to do? Then I could be a little more helpful I hope :-)

However, each control can listen for any number (Only limited by the CPU) number of other controls. Though you will have to set up a listener for each object you want to check. Maybe a general listen for collisions between these objects handler might be helpful? I will think about this for the next update.

Cheers,

Malte

Bjoern
Posts: 7
Joined: Mon Nov 07, 2011 9:41 pm

Re: aeCollision

Post by Bjoern » Tue Nov 15, 2011 9:10 am

Hi Malte,

I will try to specify what I want to do.

I set up the tList with all the towers placed, atm the each tower is a circle which represents its range. Once a mob moves through it hitpoints are reduced by a separate function.

I used set the aeListenForCollisionsWith of control "mob1" to tList and on aeCollosion pObjects to identify collisions. Which works fine for one mob.

Now I want to add multiple ones I tried setting up a second set the aeListenForCollisionsWith of control "mob2" to tList however animationEngine does not seem to like it ;-)

I hope it is only bad syntax from my side.

Cheers,
Björn

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

Re: aeCollision

Post by malte » Tue Nov 15, 2011 9:44 am

Björn,

could you post the scripts you are using?

I should be able to look into it tonight. What you describe appears to be perfectly doable though.

Cheers,

Malte

Bjoern
Posts: 7
Joined: Mon Nov 07, 2011 9:41 pm

Re: aeCollision

Post by Bjoern » Tue Nov 15, 2011 10:16 am

Hi Malte,

I attached the code.

Thanks in advance.
Björn
Attachments
TD-test.zip
(3.32 KiB) Downloaded 457 times

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

Re: aeCollision

Post by malte » Tue Nov 15, 2011 11:11 pm

Well, it appears you found a nasty little bug. I will get this fixed and upload a patched version.

All the best,

Malte

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

Re: aeCollision

Post by malte » Tue Nov 15, 2011 11:27 pm

http://www.derbrill.de/animationEngine/ ... e5.0.2.zip

Sorry for the inconvenience Björn!

To optimize your collision response in your stack, please change your wait command to

wait 1000 milliseconds with messages

All the best,

Malte

Bjoern
Posts: 7
Joined: Mon Nov 07, 2011 9:41 pm

Re: aeCollision

Post by Bjoern » Wed Nov 16, 2011 9:55 am

Thx Malte!

Post Reply

Return to “Animation Engine”