When I say: forever if timer>10, go to X0, Y0, it only works the first time. Then whenever the timer reaches >10 the second time, nothing happens. I eliminated all the STOP ALL controls, so the forever if is still working, but the script I gave the forever if never works.
Offline
Are you using a block that resets the timer every time you start the project?
This arrangement might work:
when gf clicked reset timer forever if <(timer) > [10]> go to x: (0) y: (0) endIf not, perhaps you can post a picture of your scripts.
Offline
andrewguy wrote:
When I say: forever if timer>10, go to X0, Y0, it only works the first time. Then whenever the timer reaches >10 the second time, nothing happens. I eliminated all the STOP ALL controls, so the forever if is still working, but the script I gave the forever if never works.
Basically, the forever if loop is broken once the condition is broken. To make it last forever, which you shouldn't probably do that, but if that's what you want, do this:
when gf clicked forever if < condition > do stuff... end endRegards,
Offline
CAA14 wrote:
Basically, the forever if loop is broken once the condition is broken.
Erm.. No it doesn't? It's just like forever(if(whatever)).
Offline
Hyperbola wrote:
CAA14 wrote:
Basically, the forever if loop is broken once the condition is broken.
Erm.. No it doesn't? It's just like forever(if(whatever)).
Not really. Basically, if it's an "forever if" loop, it will go on forever if the condition is true,
But an if nested in an forever loop will still check the condition forever, but it won't do anything if the condition is false.
See?
when gf clicked forever if <touching? [player v]> switch to costume [dead v] end endAs opposed to:
when gf clicked forever if <touching? [player v]> switch to costume [dead v] endThis would only check the condition once, and then it would break if the player wasn't touching whatever this sprite is.
Offline