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

Cheap dynamic shadows


While the aforementioned methods are relatively cheap, there are times when we either cannot go or don't want to go all-out with dynamic shadows. Fortunately, we can cheat a little. The main technique here involves our on-screen character and the shadow it casts on the ground.

Just as with static character shadows, where we just have a dark circle drawn underneath the character to indicate its shadow, we can use a similar approach for the dynamic version. The main difference here is that we can change the direction of the shadow based on the (dynamic) lights in the scene.

For the first step, we change the size of the shadow blob underneath each foot (or paw, or whatever our character has) depending on the distance of the foot to the ground. This should be relatively easy, but it may take some trial and error to get it to look right for your character and the style that you opt for. After this, we want the shadow to follow the scene's lighting.

Here, we can take two approaches...