Search icon CANCEL
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 Android Game Development

You're reading from   Learning Android Game Development A Beginner's guide to developing popular Android games

Arrow left icon
Product type Paperback
Published in May 2017
Publisher Packt
ISBN-13 9781785880957
Length 238 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Nikhil Malankar Nikhil Malankar
Author Profile Icon Nikhil Malankar
Nikhil Malankar
Arrow right icon
View More author details
Toc

Adding animations to make your game more awesome


To start this chapter, we will need a collection of images, which we call sprites. We saw in the previous chapter how we had used  image_1 and image_2 as examples, but we will expand on them and make this more interesting. We will try and make a proper run cycle of our player character in a sprite sheet. To understand this in a better way, let's take a look at the following image:

Our run cycle animation sprites

In the preceding image, you can observe we have a set of images that are prefixed with the text Run followed by a set of numbers that represent frames. So, basically, we will loop from frame Run_000 to Run_009, which will give us a continuous running effect. However, for the sake of simplicity, we will be merging these frames into one single image and read pixel data from it. Also, to keep it simple, we will only make the run cycle animation to three frames. If you want, you can add more frames for better animation quality. So, we will...

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 €18.99/month. Cancel anytime