Graphics Programs Reference
In-Depth Information
Figure 6-9. Heading towards the plane center
Figure 6-10 . Enemies entering the plane
The motion of each Enemy object is along linear paths, and is directed towards
the center of the plane ( Figures 6-8 to 6-10 ). Because of this, the intercept (in the
slope-intercept equation) will be zero. The value of the field _dy can be simply
obtained by multiplying the slope _slopeZ by _dx . The y-coordinate of enemy's
source position will be interpolated by _dy units. Add the interpolate method as
shown in Listing 6-20 , and also modify the Enemy() constructor as shown in List-
ing 6-21 .
 
 
Search WWH ::




Custom Search