[SOLVED]How do I make roller coaster loop?

Get help using Construct 2

Post » 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.

Image
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

Post » Mon Aug 10, 2015 4:33 pm

Is point B can move (or is it fixed?) while the object is moving?
Image Image
B
25
S
14
G
136
Posts: 876
Reputation: 71,005

Post » 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

Post » 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
96
S
33
G
20
Posts: 438
Reputation: 17,665

Post » Mon Aug 10, 2015 10:52 pm

Do you want something like this ? @VIKINGS
Image Image
B
25
S
14
G
136
Posts: 876
Reputation: 71,005

Post » 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

Post » 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
Image Image
B
25
S
14
G
136
Posts: 876
Reputation: 71,005

Post » Mon Aug 10, 2015 11:24 pm

Link updated @VIKINGS
Image Image
B
25
S
14
G
136
Posts: 876
Reputation: 71,005

Post » Mon Aug 10, 2015 11:30 pm

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

Post » Mon Aug 10, 2015 11:45 pm

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

EDIT:It's not fully optimized. You need to upgrade the code in order to use this with multiple spMovingBlock.
I've already add the random place to the roller loop, you just add the link between the 4 objects
Image Image
B
25
S
14
G
136
Posts: 876
Reputation: 71,005

Next

Return to How do I....?

Who is online

Users browsing this forum: ST314 and 30 guests