How do I use Repeat ?

Get help using Construct 2

Post » Sat Apr 23, 2016 7:04 pm

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
B
9
S
1
Posts: 60
Reputation: 611

Post » Sat Apr 23, 2016 7:35 pm

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
B
94
S
33
G
113
Posts: 5,356
Reputation: 73,273

Post » Sun Apr 24, 2016 4:07 pm

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 !
B
9
S
1
Posts: 60
Reputation: 611


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 64 guests