How do I Destroy Both Colliding Objects

0 favourites
  • 11 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I am trying to make borders on a sprite to keep the player inside of it. The borders are 4 separate objects and when they collide, they must destroy themselves. So if 2 of that object are next to each other, the player should be able to walk between objects, but not outside of them, like if you were mining, you cant go outside the mine because there is a solid, but of you destroy more, you can walk more. If you have a more efficient way of doing what I am trying to do, please tell me :D (Even if it means I need to start over).

  • Sorry, I'm not sure I understand.

    These 4 objects - are they like 4 walls in a room, and player can walk between these walls?

    Or are they like 4 invisible boxes attached to the player from each side, used to detect collisions?

    Which objects do you want to destroy and when?

    It would also help a lot if you share your capx.

  • So, there is one object and the player cannot leave it, like a wall. But if it adds more "territory" the player can walk between the two objects. The two objects when placed next to each other adds on to the "territory". The objects have their own borders but what I want is: When two objects go next to each other, the border between them disappear so the player may walk in both. Like: If you are restricted to one area, but you earn more area, you can walk more places. I hope this makes sense.

  • |--------------|

    |--------------| +

    |--------------|

    |__________|

    |--------------|

    |--------------| =

    |--------------|

    |__________|

    |-----------------------------|

    |-----------------------------|

    |-----------------------------|

    |_____________________|

  • The borders stick off of the objects a little but, so when another border touches, they destroy both of the borders, thus allowing the player to walk through the border to the other territory.

  • I want it so I cant pass through the stone, but when two of those objects are touching, then you can pass through the side they are touching.

    Oh, and here is the CAPX: https://www.dropbox.com/s/zbt0pzhdtz48oiv/Hide.capx?dl=0 Dont mind all the animation stuff, just look in the Borders Group in the Event Sheet.

    Sorry for the multiple comments

  • Ok, try this:

    https://www.dropbox.com/s/ak58r1s91gkd9 ... .capx?dl=0

    Is this what you are trying to make? You can add more yellow sprites during the game, extending the area. Just position then exactly next to the existing yellow sprite, without gaps.

  • This is pretty much what I am looking for . Thank You! I will now try to implement this into my game.

  • Set acceleration and deceleration to 10000 for sharper controls.

    Also you should probably remove Platform behavior, since you are using 8-Direction.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok (I hope I didn't send this 3 times)

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