Game Development Reference
In-Depth Information
On the other hand, the accuracy for an Evil Dude with a pistol at 75 feet would be
The only difference between the two is the inclusion of the
Modifier
value.
The other aspect that we haven't seen in action yet is the
Shift
parameter. If we
think back to Chapter 10, we will remember that it is possible to shift the vertex of
a parabola left or right. We do this by adjusting the value of
x
under the exponent.
If we realize that
Distance
in our formula is the equivalent of
x
, then the placement
of the
Shift
parameter along with
Distance
explains the horizontal movement of the
curve.
For example, the peak accuracy of a rocket launcher is not at 0 feet. By specify-
ing that
Shift
= 50, we ensure that the peak accuracy of the rocket launcher (i.e., the
vertex of the parabola) is at 50 feet. At 20 feet, for example, the accuracy of
the rocket launcher is only 47%—down from its peak of 50%.
All of this data is better visualized (and more easily constructed) by looking at
graphs. Figure 14.4 shows the accuracy of the four weapons based on the data for
each inserted into the accuracy formula.
FIGURE 14.4
The accuracy curves of the four weapons are a result of the
data for the respective weapons entered into the accuracy equation.