Hardware Reference
In-Depth Information
Figure 5-1:
he screen
display of the
Ping game.
On-screen Movement
Movement on the computer screen is created by drawing a number of separate pictures in quick
succession with one or more elements moving between each frame. In the case of a ball moving
across the screen, there are two components to the movement: a change in the X coordinate and
a change in the Y coordinate. Whenever you are dealing with changes there is a special word scien-
tists use - delta, which is represented by the Greek letter delta (∆) and just means “change”. So to
describe the path of an object moving in a straight line, all you need is two quantities - ∆X and ∆Y.
On each successive frame ∆X and ∆Y are added to the X and Y coordinates to get the new position
to plot the object. his deines the angle of movement as shown in Figure 5-2.
Figure 5-2:
he movement
angle deined by
the two values
∆X and ∆Y.
 
Search WWH ::




Custom Search