...tween an object smoothly

Get help using Construct 2

Post » Sun May 05, 2013 5:32 am

Hi there,

So what i'm trying to figure out in C2 is how do i move an object around to specific locations smoothly. by smoothly i mean at a flat speed. but then again it would be interesting to know how to tween with easing as well, but right now i just need an object to move from A to B at a flat speed.. and then B back to A with another game condition.

From my exploration it would seem that the bullet behavior would word in moving an object in a specific direction. 8 direction doesn't seem to offer the right options that i would expect.

what i would like to do is this:

1. object starts off screen at the bottom and automatically moves to the top of the screen stoping moving at a speed of say.. 50 pixels per sec

2. when a timer runs to 0, this object would come down at 400 pixels per sec.

what i've tried..

I can get bullet to get my object to the top of the screen, but when the timer hits 0 i can't just insert say.. -400 to reverse the bullet speed..

custom movement seems somewhat promising but it's sluggish.. seems that the acceleration to postion would be perfect if it would just let me set a flat speed... i was able to get the object to go to the top and set a condition to "stop" but i can't get it to then accelerate towards the bottom when timer hits 0..

i just feel like i'm missing some basic concept here in how to move objects around properly. maybe the "stop" command is not letting the new move action take effect, but i'm not sure how to properly setup logic like this efficiently.

Thanks!
Calebpart12studios2013-05-05 05:35:29
B
51
S
7
G
1
Posts: 869
Reputation: 5,943

Post » Sun May 05, 2013 7:58 am

You could:

a) Use a custom tween plugin: http://www.scirra.com/forum/behavior-easetween_topic53288.html

b) Use lerp function (check manual for that)

c) Implement easing functions manually, but I'd recommend solutions above :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Mon May 06, 2013 12:39 am

Hi Vee41,

Thanks for offering the feedback! I checked it out and it seems to want to have things bounce in the new place all the time.. i just want to move from A to B and back to A again when the timer variable hits 0. in a straight path.

this must be possible without the use of a plugin.
B
51
S
7
G
1
Posts: 869
Reputation: 5,943


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Yahoo [Bot], Zebbi and 19 guests