Sine help

Get help using Construct 2

Post » 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
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » 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
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » 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
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Tue Oct 01, 2013 3:47 am

ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » 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
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » 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).
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Fri Oct 04, 2013 3:12 pm

yeah I figured..thanks again!
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 19 guests