Now, say we want to make use of the easing algorithms that we saw in the
EaseGallery sample. To do that, we have to change the code by following certain steps.
To use the easing functions, we have to include the
Easing.h header file:
First we are going to add two more variables,
Vec2f startPosition[CIRCLE_COUNT]; Vec2f currentPosition[CIRCLE_COUNT]; Vec2f targetPosition[CIRCLE_COUNT]; float circleRadius[CIRCLE_COUNT]; float circleTimeBase[CIRCLE_COUNT];
Then, in the
setup() method implementation, we have to change the
currentPosition parts to
startPosition and add an initial value to the
circleTimeBase array members:
startPosition[i].x = Rand::randFloat(0, getWindowWidth()); ...