Book Image

Mastering AndEngine Game Development

By : Maya Posch
Book Image

Mastering AndEngine Game Development

By: Maya Posch

Overview of this book

AndEngine is a popular and easy-to-use game framework, best suited for Android game development. After learning the basics of creating an Android game using AndEngine it's time you move beyond the basics to explore further. For this you need to understand the theory behind many of the technologies AndEngine uses. This book aims to provide all the skills and tools you need to learn more about Android game development using AndEngine. With this book you will get a quick overview of the basics of AndEngine and Android application development. From there, you will learn how to use 3D models in a 2D scene, render a visual representation of a scene's objects, and create interaction between these objects. You will explore frame-based animations and learn to use skeletal animations. As the book progresses, you will be guided through exploring all the relevant aspects of rendering graphics with OpenGL ES, generating audio using OpenSL ES and OpenAL, making the best use of Android's network API, implementing anti-aliasing algorithms, shaders, dynamic lighting and much more. With all this, you will be ready to enhance the look and feel of your game with its user interface, sound effects and background music. After an in-depth study of 2D and 3D worlds and multi-player implementations, you will be a master in AndEngine and Android game development.
Table of Contents (21 chapters)
Mastering AndEngine Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Project requirements


To quickly set up an AndEngine application, we follow the general procedure of pulling the current AndEngine code from the AndEngine GitHub repository and using it as a library project dependency in our project. We will be using the GLES2-AnchorCenter branch for our project because it's the most current development branch at the time of writing this book. An additional advantage of using the AnchorCenter branch is the main change from the GLES2 branch—it uses the same coordinate system as OpenGL, in the sense that the origin is in the bottom-left part of the screen. This will make our lives easier later on, as it will save us the trouble of having to convert between two different coordinate systems.

Another difference between GLES2 and AnchorCenter is that the former positions new objects by default with the corner as the anchor point, while in the latter's case, the default anchor point is at the center of the object. We can change the anchor point wherever needed, of course, but it's good to be aware of this default behavior when we start positioning objects.

When setting up the new Android project, we target the latest available Android SDK version (4.4.2 at the time of writing this book) and use 2.2 as the minimum SDK version, since this is what GLES2 and the related AnchorCenter branch of AndEngine require. The project we are going to create is just a general, blank Android project without any associated themes or input methods. When presented with the choice to enable any of such options in Eclipse/ADT or another wizard, do not choose any of them. What we need is a blank slate, with only a basic Activity class as the starting point.

During the course of this book, we will use Eclipse/ADT as the development environment. In this IDE, we need to get the AndEngine project imported into the workspace so that in the properties of our new project, we can add it as an Android library dependency. Other development environments will have a similar setup, but we'll leave the details of these as an exercise for you.