Is there a way to do this better?[Solved]

0 favourites
  • 7 posts
  • I am making a top down game and I currently have a platform you can stand on and it will move you around when you are standing still.

    I also have it where you can move when you are on it.

    My problem is the player's movement is not affected by the platform so when you move up when the platform is moving right the player does not stay on the platform. Is their a better way to do this so the platform's movement affects the player?

    I attached my capx to it

  • ... .capx?dl=0

    this is a link to the capx

    I keep getting a error when trying to attach it or edit my post

  • first thing:

    instead on key released, I would recommend using player is not moving, for when I moved by using the arrow keys the pinning didn't work..

    second thing:

    Maybe pinning the player isn't the best option here..

    setting the player's position to the platform minus or plus the current location of the player compared to the platform could be a better option.

    limiting the player's x and Y while overlapping the platform would be something like:

    player is over lapping platform - player set x to clamp(player.x,platform.x-0.5*platform.width,platform.x-0.5*platform.width)

    player set x to clamp(player.x,platform.x-0.5*platform.width,platform.x-0.5*platform.width)

    If I'm correct.

  • can be smart..or you can be stubborn <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> ... 2290447519

  • Thank you for the quick reply

    not going to let the arrow keys affect player going to disable that

    I am trying to do what you said but I am not having any luck, when I put it in it sets the player set X and y to the edge of the platform rather than to where he is currently on the platform. it also does not allow him to move if i set both the X and y. Is there any way you could show me a capx of it?

  • Korbaach I do really appreciate your help, but their is a glitch with just pinning the character to the platform, it makes it where if u move perpendicular to the movement of the platform it will move out from under you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok I figured out a way to do it, All i needed to do what make it where the player is being moved at the same speed and direction of the platform. So I used the move object at angel command. It works it just took a bit of tweaking to get the speed for the player right.

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