Sine add function to play a single cycle

Get help using Construct 2

Post » Sun Jun 23, 2013 3:28 am

I'm trying to find out how to edit the Sine behaviour and adding a function that makes the Sine only play a single cycle, then disable itself again.

Anyone that can point me in the right direction? I've been fooling around with the code a bit but couldn't get it working.

PS. This might be something that can be added to C2, a function that plays a Sine for X cycles.
B
26
S
3
G
2
Posts: 98
Reputation: 2,887

Post » Sun Jun 23, 2013 5:03 am

Your answer is in this link, about half way down.

Sine
B
56
S
15
G
13
Posts: 826
Reputation: 17,645

Post » Sun Jun 23, 2013 6:32 am

Not really though, there doesn't seem to be a function that does a single (or X amount of) cycle of the sine behaviour.

Hence why I asked how to add one.
B
26
S
3
G
2
Posts: 98
Reputation: 2,887

Post » Sun Jun 23, 2013 6:48 am

Just use a timer and enable/disable accordingly.

Set active
Enable or disable the behavior. When disabled, the behavior does not affect the object at all.
B
56
S
15
G
13
Posts: 826
Reputation: 17,645

Post » Sun Jun 23, 2013 6:54 am

Really though, I'd just like a function to do the cycle once. Adding timers and stuff is certainly possible, but I rather not.
B
26
S
3
G
2
Posts: 98
Reputation: 2,887

Post » Sun Jun 23, 2013 11:10 am

If you don't find a hard-coding solution, you could do it with a single event. Compare two values [Sprite.Sine.CyclePosition >= 0.99] -> Sprite Set Sine Inactive.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606


Return to How do I....?

Who is online

Users browsing this forum: Darknessed and 38 guests