mask an overlapping sprite

0 favourites
  • 3 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • <img src="http://eventorbot.files.wordpress.com/2013/07/overlap-example1.png" border="0">

    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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • add (invert) "is Not overlapping Box" to the destroy action:

    change:

    current target behaviors:

    on touch the targets "destroy" "add 1 to score" and "subtract 1 from ammo"

    this is working.

    to:

    current target behaviors:

    on touch the targets "destroy" "add 1 to score", "not overlapping box" and "subtract 1 from ammo"

  • 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 !

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