How do I use Repeat ?

  • Hello

    Currently I have this :

    IF

    A = 1

    Trigger once

    THEN

    set box.opacity to 0

    wait 0.1 seconds

    set box.opacity to 1

    wait 0.1 seconds

    set box.opacity to 0

    wait 0.1 seconds

    set box.opacity to 1

    wait 0.1 seconds

    set box.opacity to 0

    wait 0.1 seconds

    set box.opacity to 1

    wait 0.1 seconds

    and it's working fine.

    But I would like to replace it with Repeat

    I tried this :

    IF

    A = 1

    THEN

    Repeat 3 times

    set box.opacity to 0

    wait 0.1 seconds

    set box.opacity to 100

    wait 0.1 seconds

    but it doesn't work, opacity stays at 0. I also tried by adding trigger once here and there and it doesn't work either. What is the proper way to use repeat ?

    Many thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think the wait tutorial shows a similar example but this would work:

    a=1

    trigger once

    repeat 3 times

    --- wait loopindex*0.2 seconds

    --- set opacity to 0

    --- wait loopindex*0.2+0.1 seconds

    --- set opacity to 100

  • Ok ok, I read the repeat tutorial but I wasn't using the wait with repeat, I think I understand how it works now.

    Thank you very much !

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