Let's calculate a new direction:
We definitely had some variations in our game. Using 90 - direction did not produce a playable game. When we simplified the direction to 180, our game exhibited a similar unplayable behavior, but a setting of 0 seemed to work.
In the original point in direction block calculation, 180 is a constant and we subtracted the direction of the ball, which was stored in the direction block, a variable, to get a new direction value.
Here's an example calculation that uses 121 as the ball's direction. The program subtracts 121 from 180 to get 59. Therefore, the value of the point in direction block becomes 59.
The original calculation always seems to bounce the ball off the paddle and put it in play. When we changed our calculation to use 90 - direction, the ball's behavior became much more erratic, and it may have failed to bounce off the paddle.
When we simplified our direction, we tried setting a constant value of 180, but if you recall our direction discussion from Chapter 5, you will remember that 180 represented a down direction. When we set the direction to 0, the ball bounced off the paddle as expected.
The point in direction block is not the only calculation in the script that affects the ball's direction. Let's take a closer look.