Book Image

Learning Android Game Development

By : Nikhil Malankar
Book Image

Learning Android Game Development

By: Nikhil Malankar

Overview of this book

In this book, we’ll start with installing Android studio and its components, and setting it up ready for Android N. We teach you how to take inputs from users, create images and interact with them, and work with sprites to create animations. You’ll then explore the various collision detection methods and use sprites to create an explosion. Moving on, you’ll go through the process of UI creation and see how to create buttons as well as display the score and other parameters on screen. By the end of the book, you will have a working example and an understanding of a 2D platform game like Super Mario and know how to convert your 2D games to 3D games.
Table of Contents (17 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
4
Creating Sprites and Interactive Objects

Resource folder in detail


In the last chapter, we used the activity_fullscreen.xml file to edit the frontend of our application. Now, we will take a look at some more of these XML files and understand how they can be useful to us for making games. To understand these type of files, we must first know a little bit about them. To start off, the very basic information about XML is that it's a short form of Extensible Markup Language. Now, if you have studied HTML, you will know that its full form is quite similar to it--HyperText Markup Language. It's quite similar in syntax as well, but the function of an XML file is to hold data. If you go by the definition of an XML file, it goes something like this: XML is a software and hardware-independent tool for storing and transporting data.

You can read more about XML files at https://en.wikipedia.org/wiki/XML.We have not yet seen an XML file in the code yet, so let's do that. Click on Text as shown in the following screenshot:

The Text mode for code...