How do I change sine behavior speed as time progresses?

Get help using Construct 2

Post » Tue Aug 08, 2017 7:59 pm

Hey all. I am making a game where two instances of the same rope are swinging back and forth right now at same speed using sine behavior. How can I make it so that as time progresses, both of the ropes' swinging movement keeps getting faster?
B
12
S
3
G
3
Posts: 35
Reputation: 2,272

Post » Tue Aug 08, 2017 11:54 pm

If you decrease the Sine's period parameter it will cycle faster, so just use a timer to periodically decrease it, or use dt to decrease it steadily over time or somesuch.

E.g.
[Set timer behavior to 5 sec repeating]
[On timer] --> Set period to CurrentPeriod - 5

or

[Every tick] --> Set period to CurrentPeriod - dt
B
49
S
23
G
17
Posts: 291
Reputation: 12,407

Post » Wed Aug 09, 2017 7:26 pm

Would you mind sending a capx file as an example illustrating this?
B
12
S
3
G
3
Posts: 35
Reputation: 2,272

Post » Wed Aug 09, 2017 10:23 pm

https://www.dropbox.com/s/qa5ak3rqfqjkplz/SineEg.capx?dl=0

It's the absolute basics so you'll have to tweak it to your needs.
B
49
S
23
G
17
Posts: 291
Reputation: 12,407

Post » Wed Aug 09, 2017 11:40 pm

Sup with that?...your example speeds up and gets faster but then slows back down after speeding up over time. Can you make it so that it just keeps speeding up over time and never stops getting faster?
B
12
S
3
G
3
Posts: 35
Reputation: 2,272

Post » Thu Aug 10, 2017 12:40 am

That's just because eventually the period becomes a negative number and starts "increasing" again in the eyes of Sine behavior. As I said, it's a really simple example.

You can just put in a condition to prevent it from going below 0.1 or something to make sure it doesn't slow down again.
B
49
S
23
G
17
Posts: 291
Reputation: 12,407

Post » Thu Aug 10, 2017 4:57 pm

http://imgur.com/a/JORp5 .... If you look at this link, I tried this similar to what you said sup with that and it didn't work. It gets faster but then stops moving at a certain point and doesn't get faster anymore unless I shift/move the mouse after it stops moving . Either way, it still isn't just progressively getting faster. The sprite/object will either get faster and then stop moving or will get faster progressively but then stops getting faster and stays at same speed. Any ideas/help?
B
12
S
3
G
3
Posts: 35
Reputation: 2,272



Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests