Sine help

Get help using Construct 2

» Mon Sep 30, 2013 2:59 am

hi,

Is there a way to get the sine behavior to rotate? I'm aware of the Forwards/Backwards movement which stays true to the sprite's rotation, but I need my sine going the other way (Left/Right). I could just turn the direction of the sprite itself, but I don't want to that because then all the directional stuff will be messed up.

I have a turret behavior that keeps the enemy facing the player, but I always want the enemy moving side-to-side.

Actually what I really want is a figure 8 pattern using 2 sines (1 vertical and 1 horizontal) and I'd like to be able to rotate that movement as the enemy rotates.

is it possible?

capx
B
103
S
35
G
16
Posts: 1,227
Reputation: 17,198

» Mon Sep 30, 2013 3:48 am

Just use two sine behaviours, with one having twice the period of the other.

sine_test_BHT.capx
B
71
S
22
G
288
Posts: 3,859
Reputation: 158,424

» Mon Sep 30, 2013 5:16 am

hey that's a neat idea to make the trails.. thanks for that! it really helps seeing the movement pattern.

I've done the figure 8 pattern before, but I was wondering if I could get the figure 8 pattern to rotate... as the player moves around.

it doesn't seem possible using normal sine behavior.
B
103
S
35
G
16
Posts: 1,227
Reputation: 17,198

» Tue Oct 01, 2013 3:47 am

B
71
S
22
G
288
Posts: 3,859
Reputation: 158,424

» Thu Oct 03, 2013 4:52 am

excellent.. I'm still working out the math and how you actually did this... thanks for helping out, would never have got to that on my own! (I really need to brush up on some math!)

all those actions probably need to be modified for use with dt right?
B
103
S
35
G
16
Posts: 1,227
Reputation: 17,198

» Fri Oct 04, 2013 7:06 am

Yes. You'd need to monkey with the Interval. The '60' value is the key value here to be adjusted. That was arbitrarily chosen. (All others are relevant to the behaviour itself).
B
71
S
22
G
288
Posts: 3,859
Reputation: 158,424

» Fri Oct 04, 2013 3:12 pm

yeah I figured..thanks again!
B
103
S
35
G
16
Posts: 1,227
Reputation: 17,198