How do I overlap Y positions / manage positions?

  • Hi, everyone!

    I'm trying to overlap Y positions where i'd like my character goes up ,climb a vine, like a rope.

    I'm not using Pin. I'm seting positions. When Player colides he follows vine's angles and positions X and Y. The Player can swing applying impulse right and left. I'd like to make the player goes up Y pressing down a key, but i can't, cause he already fixed on the vine's Y position.

    When i set player's position to follow vine"s angles and position X and Player Y, to free that vector, the player doen't follow the vine, he stays floating away when the vine is swinging.

    The vine has 7 sprites with Physics and Joints - Everything works ok My only problem is to make the player climb and Swing the vine simultaneously preserving both Y coordinates.

    Player | Vine=1 => set position to (vine.ImagePointX(0),vine.ImagePointY(0))

    => set angle to Vine.Angle degress

    Player | Vine=1 =>

    -- Up Arrow is down => Set 8direction vector Y to -90

    -- Down Arrow is down => Set 8direction vector Y to 90

    Thx for the attention.hope anyone here could help me :)

  • See this demo:

    dropbox.com/s/ab0uil41nt3itfj/ClimbSwingingRope.capx

    It's difficult to do this with 8direction behavior actions, you'll need to disable or ignore its controls while the player is climbing the vine.

  • Thx a lot! Im studying how you seted this up.

    Your "player"starts already hanged in the swing bar (vine). For instance, if your player jump in the vine, as you setted, he automaticaly goes to the "end" point, where "climbProgress"is almost 0. How could i set up to make the player sticks everywhere on the vine, not always to the "climbProgress".

    It Jumps, colide everywhere on the vine, sticks and after that starts counts "climbProgress" from that point.

    Thx one more time. Really appreciate your help. :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can use unlerp() expression to calculate ClimbProgress variable at the point of collision.

    For example:

    Player On collision with Vine
     Player set ClimbProgress variable to unlerp(vine.ImagePointY("end"), vine.y, player.y)
    

    And then you activate that event which will update player position on the vine, based on the progress variable.

  • AWESOME! Works great! Now i can grab an change position Y while swinging.

    One problem: When i copy (instance) the vine, when i try goes up and the vines overlaps each other, the player changes position automatticaly.

    I think the problem occurs when the unlerp is in action, when these points got crossed and the numbers goes crazy and doesn't knows what vine to choose.

    I think that i have to create a condition to tell to the player stays in that vine until next action. I tried "Pick nearest" but no sucess! the Player still changes positions and jumps to the next nearest vine point. This problems only happens when i try to goes up, if i stay in place and swing i have no problems with the position.

    Thank You so much! You already helped me a lot. Im begining with Construct, that's my first project. I know its hard to explain, but you are great. :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)