Bobbing platforms

  • Hello

    I'm new here, just started using Construct and working on my first game!

    I�m wanting to make a platform that bobs/sinks down slightly (say 50 pixels) when the player jumps on it, then reverts to its original position when you jump off.

    I thought this would be easy but I keep hitting a few blockers. I tried using the Lerp and Clamp commands to make it move down slowly which did work but I had the issue of my player always colliding with it so it continued down off the screen. (How do I say do this command only once when you collide with the platform?)

    As for getting it to revert to its original position I couldn�t get that working at all and wasn�t sure where to start. I thought I�d create an �else� command on the collision detection that makes it move back but I wasn�t able to find a way to add it to my event sheet (it was greyed out).

    I�m at work at the moment so don�t have a Capx but would appreciate some advice or pointing to a tutorial that I may have missed.

    I later installed the Ease Tween plugin and that gave me a nice elastic motion, but it either kept moving down or looping from the original position (again, same issue of only wanting to play the motion once and then revert when you're not in contact anymore)

    Here's a little diagram to illustrate what I'm trying to do :)

    <img src="https://dl.dropbox.com/u/3796932/platform_logic.jpg" border="0" />

    Thanks

    Simon

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thought this would be easy but I keep hitting a few blockers. I tried using the Lerp and Clamp commands to make it move down slowly which did work but I had the issue of my player always colliding with it so it continued down off the screen. (How do I say do this command only once when you collide with the platform?)

    There's a condition you can add called TRIGGER ONCE WHILE TRUE.

  • I've managed to get something like you wanted using an instance variable on the platform. Hope it helps.

    Here's the CAPX

    and a DEMO

  • Thanks Vandinz, that is what I was looking for. I will try and hook the soft movement back into it. I just needed a prod in the right direction.

    Simon :)

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