Loop: Every tick ok, but not every x seconds

Get help using Construct 2

Post » Mon Jan 06, 2014 10:37 pm

This is for a fuel bar. The 2.31 is the adjust for the size in pixels.

Event: Repeat IntervalSize times

Subevent: Every tick: Liquid(Sprite) - Action: Set size to (64, loopindex*2.31)


It works but obviously too quick, the meter is from one position to another in a "blink".

But if I change Every tick to let's say Every 0.2 seconds it won't work at all, the bar is still in the old position.

Do you know why?

Are there a way to do "Every 20th tick"?

I have a feeling I am doing this wrong because tick is basically "always" and maybe not same thing as time, right?

Thank you for reading. :)
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Mon Jan 06, 2014 10:46 pm

have you tried with every 0.0166 (basically every tick in seconds), and checked if it still doesn't work?

Are you also sure that the timescale is set to 1?
Is the "ever x seconds" command linked to another context sensitive event?Tinimations2014-01-06 22:50:36
B
32
S
10
Posts: 370
Reputation: 3,156

Post » Mon Jan 06, 2014 10:47 pm

It won't work! Just like with seconds, no change.

B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Mon Jan 06, 2014 10:50 pm

Are you also sure that the timescale is set to 1?
Is the "ever x seconds" command linked to another context sensitive event?
B
32
S
10
Posts: 370
Reputation: 3,156

Post » Mon Jan 06, 2014 10:57 pm

"Every" under a loop makes no sense. Loops run instantly without waiting. You probably want to put the loop under the "every" event instead, which means it will run the (complete) loop that often.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Mon Jan 06, 2014 11:09 pm

Ok I realize it now as you put it, Ashley! Sorry about that.

But let's say "do this thing" and then "wait x seconds" in a loop should be theoretically sound? But it won't wait until x seconds have passed but go on to next iteration at once ignoring the wait time. Hmm.

Ok what I wanted to do is resize a sprite a fixed amount over a period of time (so it is smoothly growing) and not instantly. Maybe loop is not the way to do?helena2014-01-06 23:10:40
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Mon Jan 06, 2014 11:16 pm

Look at the LiteTween plugin
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Mon Jan 06, 2014 11:19 pm

Looks nice! Thank you, blackhornet!
Love this forum, so many helpful people!helena2014-01-06 23:21:35
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Tue Jan 07, 2014 12:09 am

Thank you again, Blackhornet for introducing litetween to me! It is PERFECT! I can see I am going to use it for many things.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735


Return to How do I....?

Who is online

Users browsing this forum: blue visionary, dop2000, OBLIVION, zenox98 and 13 guests