We are now to the point where we can build the controls for the player. As we said in the introduction, we will be building two control schemes. The first is what we call "one touch". This controller will track from the moment the touch is detected until it is released. While the touch is on the screen, we will update the cue stick to follow the touch, aiming at the cue ball. When the touch is ended (finger lifted) we will take the shot from the position of the cue stick, and the distance from the cue ball will determine the strength of the shot.
The second control scheme, which we call "two touch", will be similar in the way it tracks the shot, but it will not automatically take the shot when the touch is lifted. Instead, a button that says Shoot! will appear at the bottom of the screen, and touching that button will take the shot.
Both control schemes share some code, so we have created the OPControlBase
class, which we will then subclass with OPControlOneTouch
...