I’ve simplified my question from my previous question (I hope). Please see the demo program of what I’m trying to achieve:
https://www.dropbox.com/s/zfg3crvoohrrhij/bouncingDemo.mov?dl=0
The above demo shows an orange square bouncing which should land on a green square after the orange square bounces “X” times (where “X” is a ‘bounce count’ defined in advance). For example, after the orange square bounces 2 times, it MUST land on a (scrolling) green square on the 3rd bounce (“X”) and increase in height again and resume bouncing.
At the moment, the orange square lands on the green square as expected but other times it lands just before or after it. I add the green squares (off screen) and move them by changing their ‘x’ co-ordinate every frame (scrolling across the ground). The orange square is moved (bounced) using transitions (rather than changing it’s ‘y’ co-ordinate every frame as I want the ‘bounce’ to look realistic).
What is the best way to guarantee the orange object lands on the green object after 3 bounces (as an example)?
I’d truly appreciate any ideas as I’m out totally out of them at the moment.