How to make a ladder?

For questions about using Classic.

Post » Thu Sep 11, 2008 9:39 pm

I've been trying, but it never works quite like I want it to.

Help me, please :(
B
2
S
1
G
4
Posts: 92
Reputation: 1,384

Post » Thu Sep 11, 2008 11:27 pm

What have you tried?

Also, I'm not on my Construct computer right now, but I can work up an example later on when I get to it. If someone doesn't beat me to it.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Sep 12, 2008 1:55 am

I've tried that when the player is overlapping the ladder and presses up or down, set the gravity to 0, then move the player up or down TimeDelta*200, and restore gravity if left, right, or jump is pressed...

By the way, I'm using the Platform Behavior.

When I keep going down the ladder and get to the ground, the player starts sliding to the left.
Also, if I press up and THEN jump to the ladder, the gravity is set to 0 anyways.
B
2
S
1
G
4
Posts: 92
Reputation: 1,384

Post » Fri Sep 12, 2008 2:46 am

Hm not sure if this works but

GOING UP??
player overlaps ladder
+
key up pressed
>set gravity to 0 (needed I guess?)
>player set y to player.Y - 2 (you can increase/decrease that)

GOING DOWNNN?
player overlaps ladder
+
key down pressed
>set gravity to 0 (needed I guess?)
>player set y to player.Y + 2 (you can increase/decrease that)

that's rough and it probably needs more to function right...
B
13
S
3
G
5
Posts: 286
Reputation: 3,193

Post » Fri Sep 12, 2008 2:12 pm

it may also help to make a condition that is inverted:

IE.

player is overplapping ladder (inverted)
player is pressing up (inverted)
-restore gravity to whatever you have it set to

this way, if you do something like jump at the top, the gravity will set itself back to what its meant to be and it wont get stuck being 0.
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Fri Sep 12, 2008 3:52 pm

Sorry it took so long, I couldn't use my Construct computer all day yesterday, so I just whipped this up in the last twenty minutes. It seems pretty solid, but I know it could probably be cleaned up a little (especially the centering-on-ladder code, it's a bit redundant having it occur twice). At the very least it should give you an idea of where to go from here.

http://www.fileshack.us/get_file.php?id ... ladder.cap

The whole thing's commented, but if you have any questions just ask.

But yeah, everyone posting suggestions in this thread were pretty much on the right track, except I used Set Speed in the Y direction instead of manually setting the Y position (that could cause problems with clipping into solids).
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Sep 13, 2008 1:46 am

Well, did it work out for you?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Sep 14, 2008 3:54 pm

Warm it up Kr!s

[quote="Kr!s":3sks8uda]I'm about to[/quote:3sks8uda]
Warm it up Kr!s

[quote="Kr!s":3sks8uda]That's what I was born to do[/quote:3sks8uda]
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Sep 15, 2008 3:44 am

Thanks a lot!
I merged your code with mine to achieve exactly what I wanted.

I'm really happy I got that solved! :D

I'm working on a big project and it's nice to have things working perfectly in this early stage to avoid dealing with annoying problems later.

Thanks, deadeye!
B
2
S
1
G
4
Posts: 92
Reputation: 1,384

Post » Mon Sep 15, 2008 4:28 am

Glad it worked out for you. I was going to post annoying stuff in this thread until you came back to check on it :twisted:

I guess I'm off the hook now.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests