Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Java by Building Android Games

You're reading from   Learning Java by Building Android Games Extend your game development skills while learning Java – follow this book and learn Java for Android to enter the world of Android games development with greater confidence

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784398859
Length 392 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
John Horton John Horton
Author Profile Icon John Horton
John Horton
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Why Java, Android, and Games? FREE CHAPTER 2. Getting Started with Android 3. Speaking Java – Your First Game 4. Discovering Loops and Methods 5. Gaming and Java Essentials 6. OOP – Using Other People's Hard Work 7. Retro Squash Game 8. The Snake Game 9. Making Your Game the Next Big Thing A. Self-test Questions and Answers Index

Animation, sprite sheets, and the Snake home screen


In the previous chapter, we used a bitmap to draw text, a circle, a line, and a single pixel on the blank bitmap we created in Java code. We then displayed the bitmap with all of its doodling using the Canvas class. Now we will look at a technique to draw two dimensional images, sometimes referred to as sprites. These are made from predrawn images. The images can be as simple as a plain pong ball or as complex as a glorious two-dimensional character with muscle definition, elaborate clothing, weapons, and hair.

So far, we have animated with unchanging objects, that is, we have moved a static unchanging image around the screen. In this section, we will see how to not only display a predrawn bitmap image on the screen but also continually alter it to create the illusion of on-the-spot animation.

Of course, the ultimate combination would be to animate the bitmap both by changing its image and moving it around at the same time. We will see that...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image