ActionScript 2.0 :: How To Climb A Ladder
Aug 1, 2011How can I make it so that my character climbs a ladder whilst holding the down button?
[Code]...
How can I make it so that my character climbs a ladder whilst holding the down button?
[Code]...
I've struggled with this for a long time and have thrown in the towel. How the heck do you climb the ladder, then go back down again into another clip?
View 2 RepliesI know that trying to model character movement in Box2D is always hard/impossible, but I'm trying to see if there's any way to make an user-controlled object that cleanly slides against other objects, going up or down, that makes it look like the character is climbing/walking up or a down. The character could be modelled as a circle if that simplifies matters, but I don't see how I could get this effect using just a circle with a joint motor.
There's a "wheel joint" in the C++ version of Box2d, which I suppose I could port to Flash, but I don't know if that would give the correct effect either. Another idea I had was to have the character do little jumps, based on the normal of the object that it is touching. But I suspect that at corners, or at contacts with multiple objects, this will give weird results.
I'm trying to get a movieclip of a person to climb a movieclip of a wall, but the wall is uneven, so I'd like the person to hug the surface of the wall closely (without leaving it at all, actually) as it climbs vertically up it.
This is the code I've come up with, but the player just goes to the wall's initial x value and climbs straight vertically from there, without following the curve of the wall:
Code:
var climbSpeed:Number = 5;
addEventListener(Event.ENTER_FRAME, climbing);
function climbing(evt:Event):void {
[code]....