defining custom collision masks

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Tue Sep 06, 2011 9:26 pm

I really haven't figured much out about the way collision detection works,
and it seems to be handled most by runtime functions, is there a way to define custom collision behavior for a certain object, as a bare bones example, let's say i want any point collision queries that fall between

x=0,y=0
and x=10,y=10

I want that to register as a collision, but anywhere else I don't, assuming some other object is checking for collision with this one, or vice versa

is this possible to define that as an object specific collision behavior, or is there no way to do that?

lucid2011-09-06 21:27:59
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Sep 07, 2011 11:53 am

I don't see where this would be possible, unless you explicitly extend the collision options in general by extending collisions.cpp

It seems that collision detections are not object oriented, but method oriented.

Or you force your object to switch to no collision and handle collisions in on_frame, but I don't see how to take care of putting it to the sol if a collision condition is in use from events?

Sorry for being so vague. It's not my terrain^^
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Sep 08, 2011 11:58 am

Thanks tulamide. Yeah extending collisions.cpp is not an option, its a very specific use I need, and besides, the whole point is to make the collisions work in regular events such as the on collision event of another object.

I ended up making a separate collision box plugin that will be created and destroyed by the original plug I was asking about, basically it needed multiple separate collision boxes. So itll track the boxes, and they can communicate back whatever relevant info is needed. It also makes for more readable events than it would have if I had to figure out how to make a single on collision event, and then separate conditions to deduce which boxlucid2011-09-08 12:00:45
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests