How do I Prevent objects behind the touched object be touch

Get help using Construct 2

Post » Sun Apr 17, 2016 9:05 pm

I'm building a game where a bunch of sprites sometimes bunch up on the same location, whenever I touch a sprite that it on the front of every sprite in that specific location, all sprites behind him also triggers touch. How do I prevent this from happening.

The game is like a shooting gallery, I only want the front sprite to trigger touch.
B
3
Posts: 3
Reputation: 181

Post » Sun Apr 17, 2016 9:52 pm

solved a few times - here is one with only top object gets destroyed
https://www.dropbox.com/s/ayjjho6fdn01i ... .capx?dl=0

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Mon Apr 18, 2016 5:33 am

Thank you very much and I apologize for not looking for the solution first, before posting my question.
B
3
Posts: 3
Reputation: 181

Post » Mon Apr 18, 2016 5:40 am

Hello again, What if the object to be shot is a different element from the one behind it?
B
3
Posts: 3
Reputation: 181

Post » Mon Apr 18, 2016 5:46 am

If you're using the free version and don't have access to Families, the best way to approach it would be to make every (let's say we're talking about enemies here) all just different animations on a sprite, rather than a sprite for each enemy

So your enemy sprite would have animations like "enemy1_walk", "enemy1_shoot", "enemy2_walk", "enemy2_shoot", etc
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249


Return to How do I....?

Who is online

Users browsing this forum: koops, Yahoo [Bot] and 5 guests