Chapter 9. Canvas Games: Part II
Geo Blaster Basic was constructed using pure paths for drawing. In its creation, we began to cover some game-application-related topics, such as basic collision detection and state machines. In this chapter, we focus on using bitmaps and tile sheets for our game graphics, and we add sound, using techniques introduced in Chapter 7.
Along the way, we update the FrameRateCounter
from Chapter 8 by adding in a step timer. We also examine
how we can eliminate the use of a tile sheet for rotations by precreating an
array of imageData
instances using the
getImageData()
and putImageData()
Canvas functions.
In the second half of this chapter, we create another small turn-based strategy game using bitmaps. This game is roughly based on the classic computer game, Daleks.
Get HTML5 Canvas, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.