0 Favourites

How do I make a collision polygon with separate parts?

  • I need to give this shape a collision polygon (see attatched image below).

    http://imgur.com/a/twokX

    The black parts will not have collision (the player walks through those areas). The parts that are not completely black need to have collision so the player can collide with them. How do I make a collision polygon with 4 separate boxes to cover those areas?

  • I need to give this shape a collision polygon (see attatched image below).

    http://imgur.com/a/twokX

    The black parts will not have collision (the player walks through those areas). The parts that are not completely black need to have collision so the player can collide with them. How do I make a collision polygon with 4 separate boxes to cover those areas?

    If its a single sprite then you can't as the collision mesh always have to be connected. A way to solve that is to have a collision mesh layer so to speak, which are separated from the actual graphic. So on this layer you only have collision objects that you can arrange so they fit with the graphic layer.

    Another way, and maybe the most obvious choice seeing that you are using squared graphic objects, would be to use tile maps, as it would be faster and more performance friendly than using sprites.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Use invisible sprites pinned to the original sprite. Each invisible sprite acts as its own "collision area".

  • > I need to give this shape a collision polygon (see attatched image below).

    > http://imgur.com/a/twokX

    > The black parts will not have collision (the player walks through those areas). The parts that are not completely black need to have collision so the player can collide with them. How do I make a collision polygon with 4 separate boxes to cover those areas?

    >

    If its a single sprite then you can't as the collision mesh always have to be connected. A way to solve that is to have a collision mesh layer so to speak, which are separated from the actual graphic. So on this layer you only have collision objects that you can arrange so they fit with the graphic layer.

    Another way, and maybe the most obvious choice seeing that you are using squared graphic objects, would be to use tile maps, as it would be faster and more performance friendly than using sprites.

    I actually am using tile maps. I used a smaller tile map to create big 128x128 tilemap blocks, and with those blocks I can make levels much more quickly.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,500
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,831
minhcuong's avatar
minhcuong
Unread hot topic
106 35,969
Syazanie Amirin's avatar
Syazanie Amirin