2010 | OriginalPaper | Chapter
Bouncing Ball
Activate our intelligent search to find suitable subject content or patents.
Select sections of text to find matching patents with Artificial Intelligence. powered by
Select sections of text to find additional relevant content using AI-assisted search. powered by
In this chapter, you learned how to create an application with animation that changes based on input from the user. We covered a number of programming and HTML5 features, including
setInterval to set up a timing event for the animation
validation of form input
programmer-defined functions to reposition a circle or an image horizontally and vertically to simulate a bouncing ball
tests to check for virtual collisions
drawing rectangles, images and circles, including gradients for the coloring
The next chapter describes the cannonball and slingshot games in which the player attempts to hit targets. These applications use the same programming and HTML5 features we used to produce the animation, but take them a step further. You will also see an example of animation in the rock-paper-scissors implementation in Chapter 8.