I need some advices regarding collisions.

Get help using Construct 2

Post » Wed May 14, 2014 6:38 pm

So, Hi there :)
I'm having some troubles with collisions,
I'm making a platformer game, with semi-randomly generated worlds,
I said semi, because it just randomly picks premade structures, not make them from scratch.

So for example,
let's say some of the premade structures I have is this:

Image

That is just a .png image.
I could just edit the collision box, but I would need 12+ collision points,
and at that point the engine starts telling me that's a bad idea..
Even more considering I use 10 or 20 of those on a stage.

How could I set the collisions better/properly?
B
6
S
1
Posts: 67
Reputation: 636

Post » Wed May 14, 2014 7:00 pm

You could just use invisible dummy sprites.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,387
Reputation: 58,456

Post » Thu May 15, 2014 12:06 am

I thought that,
but as I said I'm not making the levels, they are generated randomly,
how would I know where to put them?
B
6
S
1
Posts: 67
Reputation: 636

Post » Thu May 15, 2014 7:45 am

Ahhh. I should really be more careful when reading a post :) Totally missed the randomly generated part.

The only other idea that comes to mind is to build your structures from smaller geometric primitives. That way, they can all have a default collision mask, and you can attach them based on (multiple) image point location.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,387
Reputation: 58,456

Post » Thu May 15, 2014 8:13 am

If you break your collision objects down into basic shapes such as triangles or squares and make them invisible you could run a script at the beginning of the layout to pin each collision area to the correct shape (sorry bout the pseudo script but something like)

On Start of Layout - Triangle_Object - spawn Triangle_Collision on layer 0 (image point 0)
For each Triangle

I don't know if it would be more or less efficient than other methods though as I guess you'd essentially be doubling your objects.
B
64
S
25
G
4
Posts: 204
Reputation: 6,993


Return to How do I....?

Who is online

Users browsing this forum: ChoosyZerk and 60 guests