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

Introduction to OpenGL ES


High-performance 2D and 3D graphics are supported on Android with the OpenGL library. We have the OpenGL ES API, which is used for this. This API specifies the interface for 3D graphics processing hardware. OpenGL is a huge library and from that, a part of it is OpenGL ES which is specifically created for embedded devices.

The various versions of the OpenGL ES API supported on Android are as follows:

  • 1.0 and 1.1: Supported by Android 1.0 and higher
  • 2.0: Supported by Android 2.2 (API level 8) and higher
  • 3.0: Supported by Android 4.3 (API level 18) and higher
  • 3.1: Supported by Android 5.0 (API level 21) and higher

You can read more general information about this on the official website for Android here at https://developer.android.com/guide/topics/graphics/opengl.html.

Using OpenGL ES, you can create 3D graphics on Android. Since we will be creating 3D objects, we will need to understand the coordinate system. Let's take a quick look at the 3D coordinates system that we...