Question about collision within a object

Get help using Construct 2

Post » Thu Jan 16, 2014 11:44 am

Hi all,

I've got a question i need an awnser for.

It's i think pretty simple but i want to make sure i'm going for the easy way.

I have a object looking like:


And i got a "Player" looking like:


Now i want to be able to let the player trough, but only on the "path".

The black area's should block the player, but the white(transparant) path within it should be walk-able.

I have no clue how to reach this goal at a good way.

Please explain to me how to reach this goal.

Thanks in advance!Allardje2014-01-16 11:45:30
B
10
S
4
G
3
Posts: 163
Reputation: 2,507

Post » Thu Jan 16, 2014 12:11 pm

split your object into 3 parts would be my suggestion
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Thu Jan 16, 2014 12:13 pm

That would be a good idea but the problem is that the whole piece will have the "Drag & Drop" action later. So thats a no-go.

Thanks for your reply!
B
10
S
4
G
3
Posts: 163
Reputation: 2,507

Post » Thu Jan 16, 2014 12:52 pm

Does any 1 have a nice solution? I want to start designing but i first need to know how i can accomplish this.

Thanks!
B
10
S
4
G
3
Posts: 163
Reputation: 2,507

Post » Thu Jan 16, 2014 12:58 pm

There is no such thing as collision within an object. An object has 1 collision polygon. so splitting it up would be the only easy way. After splitting it up you could pin the three collision pieces to the sprite with drag&drop. You could also choose to create invisible collision sprites over the black areas and pin those to this sprite.
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 » Thu Jan 16, 2014 1:07 pm

Here's one way - https://dl.dropboxusercontent.com/u/34306693/OddObject.capx.

It works, but it isn't pretty :)

I used the original image as an invisible placeholder and pinned the separate collision shapes to it. I also gave the invisible template the drag&drop behavior.zenox982014-01-16 13:09:32
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests