...tween an object smoothly

0 favourites
  • 3 posts
From the Asset Store
Calculate parabolic trajectories and tween objects over them.
  • 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!

    Caleb

  • You could:

    a) Use a custom tween plugin: 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 :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

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