on bullet behavior bounced?

Get help using Construct 2

Post » Wed Dec 04, 2013 12:53 pm

Hi everyone,

Is there a simple event function to detect when a sprite with bullet behavior just bounced off a solid? I don't see such a thing, but it would be very useful...similar to the animation trigger events for platformer behavior, like on landed, on jumped etc.

thanks,
Mike
B
49
S
9
G
4
Posts: 425
Reputation: 7,037

Post » Wed Dec 04, 2013 1:14 pm

An object with bullet behaviour only bounces when colliding with something, so would on collision work?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 04, 2013 1:25 pm

But how would I check on collision with ANY solid? Am I forced to put all solid sprites into a group, and then create a second group for solid tile-objects etc etc?

Since the bullet behavior can be set to bounce off of solids, wouldn't an "on bounced" event make things drastically simpler? This is exactly like what the platform behavior currently offers with "on jump", "on-land" etc.Brashmonkey2013-12-04 13:29:07
B
49
S
9
G
4
Posts: 425
Reputation: 7,037

Post » Wed Dec 04, 2013 2:43 pm

Hello! Yup, "bullet -> on bounced" condition would be pretty nice.
I've tried to emulate it, here is the capx. Not a perfect solution, but hope that might help

/Edit: Might replace obj.Angle with obj.Bullet.AngleOfMotion for a closer emulationJJList2013-12-04 14:50:50
B
17
S
5
G
1
Posts: 74
Reputation: 2,647

Post » Wed Dec 04, 2013 5:17 pm

Hi JJList,

Thanks for the suggestion and example. I had though about doing this myself, but was hoping it wouldn't be necessary and that I was simply not finding an existing feature.

This does work for my needs, just ads another variable and more events than would otherwise be necessary...I'm trying to keep as optimized as possibe.

cheers,
Mike
B
49
S
9
G
4
Posts: 425
Reputation: 7,037


Return to How do I....?

Who is online

Users browsing this forum: ksiads, MathewHarrison, mtnboy22 and 1 guest