felipenanni's Recent Forum Activity

  • Hey guys!

    I saw that gumshoe2029's examples used Physics, so I'd have to change a lot of things in the project (well, I think I'd have to change, because I never used Physics). Before trying that, I used R0J0hound calculations and it worked!

    I still need to tweak the values a little and also the camera, but he's jumping like I want to now!!! Oh, I'm so happy!

    Here's the code for when the player releases the bar:

    Thanks a lot to both of you for helping me!

  • Thanks, gumshoe2029! I'll check it when I get back from school and report here!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello!

    I'm trying to make a 2D runner / gymnastics game, where the player needs to use the arms (UP arrow) or the legs (DOWN arrow) to go through different equipment and score points. But I'm having trouble making the player grab the horizontal bar, rotate around it with the right angle and speed and then jump with the momentum acquired in the bar. After trying for a few days with no success, I'd like to ask for someone to help me.

    [If it's not recommended to put so many images, I can remove some of them. Also, I can provide the project file if needed.]

    I want the player to grab onto the yellow stick when he is in contact with the yellow circle and pressing UP. Then, while holding the button, he keeps rotating around it and gaining/losing speed. When the player releases the UP arrow, I want him to jump in the direction he was facing with a right speed. I already tried understanding the "How do I?" tutorials, but I couldn't make them work how I wanted.

    Here's how it is right now:

    At the moment, the player just attaches to the yellow circle's image point with the Pin behavior and just falls flat when the player releases the button.

    Here's the code for the horizontal movement:

    How I make the player attach to the yellow circle:

    First, I check for the UP arrow, then check if he's not on the floor (I changed in the code already, the image is not updated). If he's not already in the bar, the turn speed is set based on how fast he was going. After that, I check the angle between the circle and the player and position the player on the circle's image point, to pin on it. The angle_bar_to_player checks are there just to set the rotation direction of the circle. I feel there's something off with that - like if the player doesn't grab at the right angle.

    The code that runs while he is holding onto the bar:

    It just updates the the angle between the circle and the player, then it rotates and adapts the player's sprite.

    What happens when the player releases the UP arrow:

    It just Unpin's the player. I want him to jump in the direction he was going while on the bar.

    Can someone help me with this, please?

felipenanni's avatar

felipenanni

Member since 25 Feb, 2016

None one is following felipenanni yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies