change pupil direction
Insert three new lines of conditional code.
px = px + dpx;
if (px > 40) {
dpx = -dpx;
}
drawPupils();
px increases 0, 0.1, 0.2, ..., 39.9, 40.0, 40.1
when it reaches 40.1
The sign of dpx is reversed.
that is if dpx is 0.1, it is changed to -0.1
and if dpx is -0.1, it is changed to 0.1
So that next time px will decrease 40, 39.9, 39.8, ...