move object from point A to point B smoothly.

Get help using Construct 2

Post » Fri May 03, 2013 7:00 pm

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. nicholasgolden2013-05-03 23:00:25
Posts: 6
Reputation: 667

Post » Fri May 03, 2013 7:11 pm

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
Posts: 197
Reputation: 4,129

Post » Fri May 03, 2013 10:51 pm


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!
Posts: 6
Reputation: 667

Return to How do I....?

Who is online

Users browsing this forum: bambo, Jaraman, shoxsz, zooid and 0 guests