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 ArrayList
and enum
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 Bitmaps 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
- Add the sound effects to the project
- Code the
Snake
class - Finish 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 exactly how we are going to bring the snake to ...
Get Learning Java by Building Android Games - Second 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.