While Loop

0 favourites
  • 8 posts
From the Asset Store
SynthWave Loop Pack includes 68 seamless loops, founded on 11 original melodies.
  • As far as I know, there is no while loop for Construct 2. Is there any chance this can be implemented in a future release? Or is there a tutorial or some easy way to make a while loop using the loops given?

  • I mean you can make it using "variables" like boolean (true/false) variables. Make a condition where your "while" can not meet the circumstances and them make it change the conditional for "false", also, make it check in the begin if the conditional is true.

  • I've done something like that before, but I just wanted to say that it would be loads easier (and code space saving) if there just was an event for it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I mean you can make it using "variables" like boolean (true/false) variables. Make a condition where your "while" can not meet the circumstances and them make it change the conditional for "false", also, make it check in the begin if the conditional is true.

    I need to fake a while loop and am having trouble figuring out what this means. Can anyone put this in terms of construct?

    Edit: here is what I'm trying to do, since C2 hasn't added AngleDiff yet: gmc.yoyogames.com/index.php

  • dustingunn: I'm not really sure what that script does.

    From the description, it returns the smallest angle between two, right ?

    Couldn't you achieve the same thing with the min() expression ?

    Anyway, about while, the workaround doesn't seem to apply there, since you need the while loop to be executed in that specific tick, not over several ticks.

    (FakeWhile.capx)

    Maybe the branch plugin could be of help there (check out the plugins for C2 forum).

  • No, it returns the difference between angles while accounting for 359 and 5 being only different by 6, for example.

    Construct 1 had a very useful system command called "AngleDiff" which handled this but it's not in 2 (yet?)

  • Yet probably.

    Ashley has a huge to-do list. Some items find their way onto it, some already are there but will take more time before geting implemented into C2.

    It is a matter of time and priority.

  • You can do angleDiff with this expression:

    a is first angle

    b is second angle

    AngleDiff = acos(clamp(cos(a)*cos(b)+sin(a)*sin(b), -1, 1))

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