0 Favourites

Create a WHILE and OR condition?

  • Hi,

    Can't find an example for making a condition build of a while and or combination, just like

    WHILE "object1.number=2" OR "object.number=4" OR "object.number=25" do something

    Do I need to create a sub-condition under the while? I wonder because I need to define the action right behind the while condition.

    Looks a bit hard to understand the event system logic in such a case, if never made before.

    Any help welcome.

  • [quote:2etxsd79]Hi,

    Can't find an example for making a condition build of a while and or combination, just like

    WHILE "object1.number=2" OR "object.number=4" OR "object.number=25" do something

    Do I need to create a sub-condition under the while? I wonder because I need to define the action right behind the while condition.

    Looks a bit hard to understand the event system logic in such a case, if never made before.

    Any help welcome.

    Have exactly the same problem and doesn't seem to be any good way to do something like that due to C2 for some weird reason doesn't support "And" / "OR" in the same event condition. So I ended up doing it without a While all together. Think the only way to do it, if you need to use the while is to split it into several events.

  • You can go old-school and do it as one expression. You can see the details in the console.

  • Wow, this is really oldscool. Did not find this example anywhere.

    Many thanks hornet!

    But is there a usage for "object 1 collision with object 2" or "object 5 collision with object 6"

    I guess I need to add more variables to perform this condition. Any "oldscool" condition for an array to use a loop in this code?

    Somehow there seems to be tricky formulas in c2, which could be even easier in a js code class where you need what to do and then the export bugs appear...

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Here is an example that places an OR analysis block at the end. It is a lot like the one hornet came up with.

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