mask an overlapping sprite

Get help using Construct 2

Post » Sat Jul 20, 2013 3:07 am


I have 2 layers :
layer 1 : background image and sprites with bullet effect (the targets)
layer 2 : the boxes (stationary on top layer)
current target behaviors:
on touch the targets "destroy" "add 1 to score" and "subtract 1 from ammo"
this is working.

What Im trying to do next, is use the boxes as a mask when the targets are behind them, to cancel the touch effect on the targets..

if the box is touched the target behind the box it is not destroyed, Ive been trying to find a solution but cannot find one or work it out.
any help appreciated.
Cheers

capx file
B
13
S
3
G
1
Posts: 25
Reputation: 1,176

Post » Sat Jul 20, 2013 6:29 pm


add (invert) "is Not overlapping Box" to the destroy action:

change:
[QUOTE=thren]
current target behaviors:
on touch the targets "destroy" "add 1 to score" and "subtract 1 from ammo"
this is working.
[/QUOTE]


to:

[QUOTE=thren]
current target behaviors:
on touch the targets "destroy" "add 1 to score", "not overlapping box" and "subtract 1 from ammo"
[/QUOTE]

B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Sun Jul 21, 2013 2:42 am

thank you very much,
It was doing my head in so much I dropped the idea of boxes and
came up with another idea :)
but....I can now add this into later levels so your solution is great !
B
13
S
3
G
1
Posts: 25
Reputation: 1,176


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests