Add the move method to your class. The application must use this method to move
the circle. This method indicates wether or not the movement was a success, so you
can remove the application code to keep the circle within the screen boundaries. If
the method returns false, simple call the
reset method to put the circle back in the
middle.
It is still possible to simplify move even further. We already know movement will
always be the same. So we don’t actually need an argument at all! The movement
can be done with the information available in the class itself. (speed and the time
delta)