How do I delete only a part of background over a drawed line

0 favourites
  • 6 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hello People!

    I have a little problem with a physics game where the player can draw his own levels with the lines. I really dont know how to explain my problem by words, because my english is pretty weak, and a problem is pretty unusual i think, so i try to show.

    Okay, here we got a clear level without anything by the player.

    [attachment=2:9uc39ggm][/attachment:9uc39ggm]

    Here the player draws a line

    [attachment=1:9uc39ggm][/attachment:9uc39ggm]

    And i need to delete a part of background that is higher than the drawed line. I found a way to do that, simply spawn a white sprite with blend mode "Destination Out" on a black layer, just like in "Lighting" tutorial, and set my tiled background's blend mode to "Source In". It works fine as you can see.

    [attachment=0:9uc39ggm][/attachment:9uc39ggm]

    But! It works only when the line is straight, when the player draw's level with some inclined lines, everything's going bad... The ground then delete's under some lines, or dont delete at all where it's need to be deleted.

    Hope you understand me, and thanks for any help... Thank you even if you just read that till here

  • Ah, cant upload more than 3 pics. This is what happens if you draw a crooked level.

    [attachment=1:ewluh20g][/attachment:ewluh20g]

    And this is how i want it to be. (Paint)

    [attachment=0:ewluh20g][/attachment:ewluh20g]

  • I guess construct 2 doesn't support what you're looking for .

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I guess construct 2 doesn't support what you're looking for .

    Well, i still can make a game with just a lines. Great thanks for an answer.

  • I might have a solution though . If you think of a way of taking a curved line like above and split it into a group of straight lines . Then it might work

  • I might have a solution though . If you think of a way of taking a curved line like above and split it into a group of straight lines . Then it might work

    Nope, that doesnt work, the white thing over the line makes some parts of background transparent, some parts that i dont need to do transparent. Or maybe i just misunderstand you.

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