Ziplines!

Get help using Construct 2

Post » Sat Jan 19, 2013 8:47 pm

I've been messing around a while but can't achieve what I want. How would I go about making a zipline in a platform game? I'm trying to have; the player to be able to use it, the player speeds up the longer he rides it, it automatically dismounts player at the end and player can manually dismount. I've put put an image point on his hand but don't know how to make him follow the zipline. Should I use a bunch of combined sprites or just make separate ones for each zipline?
B
49
S
18
G
7
Posts: 429
Reputation: 8,888

Post » Sat Jan 19, 2013 9:27 pm

Sprite - Move at angle angle( ziplineStart.X, ziplineStart.Y, ziplineEnd.X, ziplineEnd.Y )

Have some invisible Sprite placed near the end of the zipline too, for when the player collides so they'll dismount.

Easier said than done I know, but I hope you get the logic ;)
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Sat Jan 19, 2013 9:55 pm

[QUOTE=procrastinator] Sprite - Move at angle angle( ziplineStart.X, ziplineStart.Y, ziplineEnd.X, ziplineEnd.Y )

Have some invisible Sprite placed near the end of the zipline too, for when the player collides so they'll dismount.

Easier said than done I know, but I hope you get the logic ;)[/QUOTE]

I don't quite get what you are suggesting, I currently have the player set to player.X + 5 and zipline.Y + 5 every tick while colliding w/ zipline but it's clunky and inaccurate, rather than spamming the object could I have it switch image points?
B
49
S
18
G
7
Posts: 429
Reputation: 8,888

Post » Sat Jan 19, 2013 10:25 pm

Or just make the cart a bullet and set angle of motion to (Zipline.Angle+45) ...Whiteclaws2013-01-19 22:25:38
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Sat Jan 19, 2013 10:33 pm

You don't need to check for collisions every tick. At first, sure, check for the inital collision with an invisible sprite at the start of the zipline. Then if collided with that sprite, set a variable "isOnZipline" to true. Disable platform behaviour. While that variable is true, then move at angle. Until it collides with another invisible sprite at the end of zipline, then set the variable to false and enable platform behaviour. Should dismount automatically using the gravity from the platform behaviour.
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Sat Jan 19, 2013 10:37 pm

[QUOTE=Whiteclaws] Or just make the cart a bullet and set angle of motion to (Zipline.Angle+45) ...[/QUOTE]

Well the zipline isn't just a line, here, I drew an example. I would have this over the actual object(s) he ziplines on. I suppose I would be able to do it with a bunch of individual objects, but is their no more efficient way?

Edit: I tried what I just said and it look horrible, the player just glitches around to each segment.

[QUOTE=procrastinator] You don't need to check for collisions every tick. At first, sure, check for the inital collision with an invisible sprite at the start of the zipline. Then if collided with that sprite, set a variable "isOnZipline" to true. Disable platform behaviour. While that variable is true, then move at angle. Until it collides with another invisible sprite at the end of zipline, then set the variable to false and enable platform behaviour. Should dismount automatically using the gravity from the platform behaviour.[/QUOTE]

Right, but what you said with the angle seemed a bit off.



Thanks for all the feedback!Draspur2013-01-19 23:14:36
B
49
S
18
G
7
Posts: 429
Reputation: 8,888

Post » Sun Jan 20, 2013 12:54 am

Use the same method of setting its angle of motion, and then add numerous invisible sprites along the line where it turns and adjust the angle.
B
40
S
12
G
7
Posts: 603
Reputation: 7,646

Post » Sun Jan 20, 2013 12:58 am

[QUOTE=EncryptedCow] Use the same method of setting its angle of motion, and then add numerous invisible sprites along the line where it turns and adjust the angle. [/QUOTE]

Like vectors !
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Sun Jan 20, 2013 2:55 am

Well it's rather clunky and inefficient but it's the best I could do. Thanks everyone for your help, if anyone wants to make this better, PLEASE tell me.

Zipline
B
49
S
18
G
7
Posts: 429
Reputation: 8,888

Post » Sun Jan 20, 2013 3:07 am

I think that looks pretty damn good. Maybe when you "disengage" the zip line-ing, give him a little push to the right and up a bit. Because a person isn't going to just stop and fall off, they still have momentum.
B
40
S
12
G
7
Posts: 603
Reputation: 7,646

Next

Return to How do I....?

Who is online

Users browsing this forum: andykenobi, blackhornet, TheHat and 1 guest