User Tag List

Results 1 to 2 of 2

Thread: Breaking out of a loop iteration

  1. #1
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jul 2006
    Location
    Falkirk,Scotland
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Breaking out of a loop iteration

    Hi everyone.It has been a long time since I posted on this site but it's good to be back.My question is:-If I have a fastloop running
    start loop"foo" 100 times
    on loop"foo"
    array_value(array,current_loop_index("foo")<=15---set_counter(random(3)

    on loop"foo"
    array_value(array,current_loop_index("foo")<=30---set_counter(random(5)

    is there any way of breaking out of the loop if for example the first condition is true so that the loop starts again from the beginning at the next iteration of the loop and checks all of the conditions again.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Breaking out of a loop iteration

    You would have to code that yourself. Put in something to test if the current loopindex should be skipped, like set a counter to 1 or a flag on or something.

    * Start of frame
    - Start loop "foo" 100 times

    * on loop "foo"
    - Set CounterIsLoopStopped to 0

    * on loop "foo"
    + array_value(array,current_loop_index("foo")<=15
    - set counter to random(3)
    - set CounterIsLoopStopped to 1

    * on loop "foo"
    + CounterIsLoopStopped = 0
    + array_value(array,current_loop_index("foo")<=30
    - set counter to random(5)

Similar Threads

  1. Replies: 7
    Last Post: 25th December 2012, 11:26 AM
  2. [Bug] Active Object Breaking Code
    By ProdigyX in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 23rd October 2011, 05:17 AM
  3. Code Breaking Entirely at Random
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 37
    Last Post: 13th May 2011, 05:46 PM
  4. breaking brick animation
    By bnanns in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 7th January 2011, 08:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •