Skip to Content
Learning Java by Building Android Games - Third Edition
book

Learning Java by Building Android Games - Third Edition

by John Horton
March 2021
Beginner to intermediate
686 pages
13h 6m
English
Packt Publishing
Content preview from Learning Java by Building Android Games - Third Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Java by Building Android Games - Second Edition

Learning Java by Building Android Games - Second Edition

John Horton
Programming Android with Kotlin

Programming Android with Kotlin

Pierre-Olivier Laurence, Amanda Hinchman-Dominguez, Mike Dunn, G. Blake Meike

Publisher Resources

ISBN: 9781800565869Supplemental Content