two overlap questions

This forum is currently in read-only mode.
From the Asset Store
Footsteps SFX Two contains 450 sounds of steps and jumps on different surfaces.
  • Hi, I have two questions about the overlapping sprite condition:

    1: How do I make it so that it registers as overlapping when the player is only overlapping the box of the sprite, but not the actual sprite? Is this possible without making a detector?

    2: Is there a way to make the game only register one sprite being overlapped by the player? For example, if there are two sprites next to eachother, and the player's box is stretched over both of them, then the one with the most pixels over it will be the one that is overlapped?

  • 1: You can try setting the sprite's collisions mode to 'Bounding box' instead of 'Per pixel'.

    2: No, there's no built in way to do this. What are you trying to achieve?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 2: No, there's no built in way to do this. What are you trying to achieve?

    I'm making a game where you can pick up items off the ground, but I don't want the player to be able to pick up two items at once.

  • If that's all you need maybe just throw in a 'pick a random' condition.

  • Maybe you can add a timer that ticks down after the player picks up an object. If he's overlapping another object he picks it up as soon as the timer ticks down.

    I would think that whichever object he collides with first will be the object that he picks up first. I mean I think that however you coded it this is probably what will happen and that's probably how you want it. So I'm not sure if a pick random is necessary.

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