How do I Move Object toward position and stop

Get help using Construct 2

Post » Thu Jul 17, 2014 11:35 am

Hello Construct lovers!

I'm practicing my skills in Construct to make my game idea come true, and I stucked with custom short movement. I want to make a bunch of objects move toward right, when the last one is shot away (similar to timberman but in horizontal perspetive). I tried to use bullet behaviour but i couldn't stop it when it moves its length/width. I tried custom movement but also i couldn't make it stop when it moves 24 pixels (its width).

I was thinking about make it move and then afer system.wait(x-seconds) stops the movement but won't be pixel perfect and it's not the right way to this i guess.

Generally I want to move it for time of 0.5 second or move 48 pixel per second and stops when it travels its width. Any ideas how to make it properly?

I've made some prototype - but in this example blocks are moved in instant 24 pixel to the right, so no fluent movment is visible.

Thanks in advance :)
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 14
Reputation: 478

Post » Thu Jul 17, 2014 11:42 am

The MoveTo behaviour might do what you want.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Jul 17, 2014 11:49 am

The way you have set it up I would suggest using the MoveTo- plugin, you can find it in the plugin section (I believe it is the most used plugin for Construct2)

Another way would be to use lerp (linear interpolation) or indeed the bullet behaviour (There's a moveto example shipped with C2 using bullet behaviour)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jul 17, 2014 12:13 pm

Wow, Thanks for such fast and accurate replay! That's exactly what i was looking for. It solves many of my issues i had on my mind :)

Thanks and Regards!
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 14
Reputation: 478


Return to How do I....?

Who is online

Users browsing this forum: irina and 5 guests