move object from point A to point B smoothly.

0 favourites
  • 3 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Hi everyone, I'm really new to construct 2 and I have a question, that I searched and searched and hit up every example but couldn't find it.

    What I want to do is this:

    Lets say I have an object. When I touch it, I want it to move up 200 pixels on the Y axis, smoothly (vertically) then move back down. I don't know the terminology but I usually know it as a "transition" or "easing" or something like that. I thought "sine" might be the way, but I need to back and forth animation to begin on the touch, go up then back down then end. I didn't find a way to control "sine" so that on "touch" I could control the movement. Usually, in code I would pass params or something like that but since this is "visual" not sure how to tackle it.

    Currently in my silly sample project I have some ground on the bottom of the screen, and a crate. When I touch the create, I apply a impulse and the crate jumps up then falls back down to it's original position. This is of course using physics.

    What I want is to not use physics, and just animate the object going from point A to Point B AND I want to have collision detection.

    I can pull this off easily writing code in other SDK's like Cocos2d, Corona SDK, Gideros, Moai etc but I wanted to use Construct 2 so I could publish to web which is something those SDK's don't do well or at all.

    If needed I put up a capx, but I think what I am asking for *seems* simple in other languages, but I'm getting used to this "point and click" construct 2 thing :)




    For those interested:

    First you will need to learn how to install plugins:

    THEN - you need to find out if it's a behavior plugin, or something else. In my case this is a behavior plugin

    So I got the plug in from here (I have less than 500 posts, I can't post links yet so sorry about that you'll have to copy and paste...I know it's soooo much work )

    Then I placed the plugin here on my windows 7 box:

    C:\Program Files\Construct 2\exporters\html5\behaviors\moveTo

    Help can be found here:

    Pretty easy to use. You can get to it from the event sheet. It has lots of options - pretty robust. <img src="smileys/smiley19.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • plugin moveto

    PosA Start Position

    PosB End Position

    Add Event OnTouch --> Object --> Moveto PosB

    Copy that Event and Invert it then change Moveto PosB to PosA

  • yonda

    Alright, so I had to figure out how to use a plug in :)

    That's COOL. That worked - I didn't know you could write your own plugins for the engine. I might have to do that :)

    I'll mark the thread as solved. Thanks YONDA! That was fast reply!

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