View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# How to implement curve movement from a source to a target?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1birdkingz  Members

Posted 18 January 2014 - 08:16 PM

Hi,

I'm trying to simulate a movement where multiple pieces of object will move towards a target by following a curve path.

Here's a picture that I've drawn for case illustration purpose

The "moving curve" that defined in the picture isn't prefixed. What am I trying to do is as long as the object able to move towards the target while having itself in a curvy path then is fine for me.

To give u better details of the final output:

Player will tap on the Big Coin object, after that the Big Coin object will split into multiple small coins and all the small coins will fly towards the player. An example of games that implemented this method is Cloud Patrol on iOS.

Edited by birdkingz, 18 January 2014 - 08:23 PM.

Seeking for Perfection

### #2Álvaro  Members

Posted 18 January 2014 - 08:57 PM

Two ideas:

(1) Treat your coins as particles with position and velocity, and place them under the influence of a strong attracting force towards the player.

(2) Create two trajectories for each coin: one that goes away from the original location in some random direction, and one that goes from the original location to the location of the player. At each step, compute the location of the coin under both trajectories and interpolate between them linear interpolation, where the weight of the first trajectory in the interpolation starts at 1 and goes to 0 following some curve (perhaps something like weight_of_the_first_trajectory = 1 - (time/transition_time)^2).

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.