Question about collision within a object

  • 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:

    <img src="http://restylemedia.nl/test.png" border="0" />

    And i got a "Player" looking like:

    <img src="http://restylemedia.nl/poppetje.png" border="0" />

    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!

  • split your object into 3 parts would be my suggestion

  • 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!

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

    Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)