Chapter 17: Manipulating Bitmaps and Coding the Snake Class

In this chapter, we will finish the Snake game and make it fully playable. We will put what we learned about the ArrayList class and enumerations to good use and we will properly see the benefit of encapsulating all the object-specific drawing code into the object itself. Furthermore, we will learn how to manipulate Bitmap instances so that we can rotate and invert them to face any way that we need them to.

Here is our to-do list for this chapter:

  • Rotating and inverting Bitmaps
  • Adding the sound effects to the project
  • Coding the Snake class
  • Finishing the game

Let's start with the theory part.

Rotating Bitmaps

Let's do a little bit of theory before we dive into the code and consider ...

Get Learning Java by Building Android Games - Third 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.