How do I continuosly show and not show a sprite

Get help using Construct 2

Post » Wed Oct 22, 2014 3:28 pm

hey folks
i am a bit stuck....
im trying to show a sprite for say 1 second, then have it not shown, then shown again for a second repeating for x times, then gradually start to reduce the time it is shown to less than a second and so on....

thanks
Dan
B
8
S
3
G
1
Posts: 87
Reputation: 1,493

Post » Wed Oct 22, 2014 4:11 pm

Hello. The best way to show and hide the sprite would be to use the set visible action which "sets the object visible or invisible (hidden)." Measure the time with the dt expression (which gives you the amount of time in seconds since the last tick.) You can set up a variable and do a variable = variable + dt and than compare that variable to some given value, say 5 sec.

To count the number of times the sprite is visible/invisible, use a counter variable (instsance variable or a global one) and increment it when the sprite is shown or hidden.

For the gradual reduce of the time, the best way would be, in my opinion, to use some quadratic function of the counter variable mentioned above.
B
6
S
2
Posts: 64
Reputation: 576


Return to How do I....?

Who is online

Users browsing this forum: ditocruz and 17 guests