[SOLVED]Best way to moving a platform vertical and stop it when we want to?

0 favourites
  • 5 posts
From the Asset Store
Wanting to do a Shot n Run game easily? Here is your chance!
  • Hey,

    again a question, sorry im newbie in construct, i tried to move a platform for up to down and form down to up and i used the sine behavior, it's ok but it doesn't do exatly what i want.

    I just want the platform go slowly down for example and stop and i want to, bur i think the sine behavior is not the best way to do that cause it does a cycle and i just want the platform go down, stop when i want, and if the player go again on it, she go up and stop when i want to.

    Here a screenshot of my code but i know it's bad:

    Thanks for help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you sure that's a screenshot of your code? :) You use an instance variable on the platform and depending what it's set to, you do object set Y to self.Y+value to move it down the screen, or object set Y to self.Y-value to move it up.

  • i updated the screenshot, its a bad monday for me :D, i guess the instance variable have the original y position of the object? i need to do it in a loop or something to give the feeling its moving slowly? for example in this loop add -2px

  • I find the good system for me, thanks

  • Yeah not instance variable, it is a condition on the object you can 'set y' every tick, so you can set y to current y + or - a value which moves it. For clarity.

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