Abstract
All of the event-driven games support different action-event update-repaint chains that are under the players’ controls to discretely drive the games for dynamically updating and repainting their output scenes. If we can continuously drive the chains, the output scenes can also be continuously changed, which makes an illusion of animation. Java provides a built-in class Thread that can be constructed as a “game loop” that continuously drives an update-repaint chain for realizing the illusion of animation. This chapter goes through a digital clock and an analog clock to discover the “game loop” for introducing the programming on sprite-based animation.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Xu, Cw. (2018). Animation Programming: A Digital Clock and an Analog Clock. In: Learning Java with Games. Springer, Cham. https://doi.org/10.1007/978-3-319-72886-5_11
Download citation
DOI: https://doi.org/10.1007/978-3-319-72886-5_11
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-72885-8
Online ISBN: 978-3-319-72886-5
eBook Packages: Computer ScienceComputer Science (R0)