The Essential Guide to HTML5

(Greg DeLong) #1

CANNONBALL AND SL INGSHOT


Figure 4-2. Rotating cannon with image as target


Figure 4-3 shows the scene after a successful hit. Notice that the cannon is rotated and the original image
for the target has been replaced with a new image.


Figure 4-3. After firing the cannon and hitting target


The opening screen of the slingshot application is shown in Figure 4-4. This application is similar to the
cannon, but the parameters of flight are set by the player using a mouse to drag on the ball and the target
is now a chicken.

Free download pdf