Change the function that calculate the next object position.