[SOLVED]How do I make roller coaster loop?

Get help using Construct 2

» Mon Aug 10, 2015 3:50 pm

Hello World,

Ok, check my super horrible drawing below. I wanna have an object that on created(I'll probably want to be able to create it in random positions, I know how to do this part) will move a certain distance from point A to point B and along the way will perform one(or more) of those loops like you see in roller coasters.
Any idea how I can do this please? I haven't a clue even what behavior to use(sine, litetween, pathfinding, splinepath, etc.) or how the events would go....

Thank you.

Last edited by VIKINGS on Wed Aug 12, 2015 10:16 pm, edited 1 time in total.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

» Mon Aug 10, 2015 4:33 pm

Is point B can move (or is it fixed?) while the object is moving?
B
29
S
18
G
160
Posts: 894
Reputation: 83,386

» Mon Aug 10, 2015 4:41 pm

Once the object is created point B would be chosen and stays fixed while the object is moving @MadSpy . And idealy after the object reaches point B it goes back(following the same path) to point A, then from A again to B and so on.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

» Mon Aug 10, 2015 5:12 pm

I would divide the line up into a series of points (the more points, the smoother the motion would appear). Each point would be a way-point, and you could determine the angle difference between each point to tell your sprite to rotate as it goes around the loop...

Each point should have a sequence number, so you can tell what the next (or previous) point should be...
B
99
S
35
G
20
Posts: 438
Reputation: 17,970

» Mon Aug 10, 2015 10:52 pm

Do you want something like this ? @VIKINGS
B
29
S
18
G
160
Posts: 894
Reputation: 83,386

» Mon Aug 10, 2015 10:57 pm

Pretty much yeah @MadSpy !^^ But can it do the loop every time it goes back and forth?
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

» Mon Aug 10, 2015 10:59 pm

Yes, he can.
Let me 5 min to see if I can do this in less of 20 events and without plugins
B
29
S
18
G
160
Posts: 894
Reputation: 83,386

» Mon Aug 10, 2015 11:24 pm

B
29
S
18
G
160
Posts: 894
Reputation: 83,386

» Mon Aug 10, 2015 11:30 pm

Yes, that's it, it's perfect! Thank you @MadSpy , send me a capx please.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

» Mon Aug 10, 2015 11:45 pm

If you can't wait, I'll share the capx as is

EDIT:It's not fully optimized. You need to upgrade the code in order to use this with multiple spMovingBlock.
B
29
S
18
G
160
Posts: 894
Reputation: 83,386

Next