overlapping problem

This forum is currently in read-only mode.
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Say I have an event like this:

    SpriteA is overlapping SpriteB - then do some action

    Although I want to make sure that every instance of SpriteA is overlapping a SpriteB before performing the action. Is this possible?

  • I suppose you could use a variable, then do:

    for each spriteA

    if overlapping sprite B

    • add 1 to variable

    if variable is equal to number of spriteAs

    • perform action

    There might be a better way, but that's how I do it.

  • cheers, that should be a good simple solution.

  • Here's one to tell your friends about:

    <img src="http://img522.imageshack.us/img522/7606/pick.png">

  • crap, nice solution! Forgot about the system overlapping thing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The advanced overlap condition should work exactly the same as the ordinary sprite overlap condition if both are set to pick, so you should be able to substitute that for a normal overlap condition. (The advanced condition is intended for when you DON'T want to pick one of the objects involved)

  • Will it work if I want to invert the overlapping condition, and then countmatching? To make sure that all of them are NOT overlapping? As it doesn't seem to work for me very well

  • Here's a picture of a problem I'm having.

    (click for bigger view)

    I don't want the value to be set until I'm certain that all of the trees are off the water tiles. But it still goes ahead with that event even when some of them are still on the water!!

    argh, torture

  • You should be able to use an else condition here.

    So event 1: objects are overlapping

    event 2, else

    so if no objects are overlapping, the else event will run.

  • What exactly are you trying to do, alspal? Is this a level builder type thing?

    Perhaps if you let us in on the effect you're going for, someone could come up with a working solution.

  • You should be able to use an else condition here.

    So event 1: objects are overlapping

    event 2, else

    so if no objects are overlapping, the else event will run.

    I think there's a limitation in the current overlapping condition which means this doesn't work, but I haven't personally tried it.

  • What exactly are you trying to do, alspal? Is this a level builder type thing?

    Yeah basically I'm placing random tree tiles around, but I don't want them touching the water tiles.

    And I want to know when all of them have are not overlapping, before I go onto the next thing that needs to be done.

  • Is this random generation? Do you need a specific number of trees for some reason?

    Why not just run a quick check after placing trees that destroys any trees that are over water?

  • yeah thats a good idea, thanks!!

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