Beginning Android C++ Game Development

Book description

Beginning Android C++ Game Development introduces general and Android game developers like you to Android's powerful Native Development Kit (NDK). The Android NDK platform allows you to build the most sophisticated, complex and best performing game apps that leverage C++. In short, you learn to build professional looking and performing game apps like the book's case study, Droid Runner.

In this book, you'll learn all the major aspects of game design and programming using the Android NDK and be ready to submit your first professional video game app to Google Play and Amazon Appstore for today's Android smartphones and tablet users to download and play.

The techniques contained in this book include building a game engine, writing a renderer, and building a full game app with entities, game levels and collisions. As part of the tutorial you'll also learn about inserting perspectives using cameras and including audio in your game app.

What you'll learn

  • How to build your first real-world quality game app for Android smartphones and tablets using the power of the Android C++ APIs as found in the NDK

  • How to do professional level, quality game design, starting the Droid Runner case study that's used throughout this book to illustrate the key concepts

  • How to build a game engine

  • How to write a renderer

  • How to build the Droid Runner game app with entities, game levels and collisions

  • How to insert perspectives using cameras and more

  • How to create or integrate audio into your game app

  • How to submit to the Android app stores like Google Play and Amazon Appstore

  • Who this book is for

    This book is for game developers looking to get into Android development for the first time, as well as Android game developers who have never used the Native Development Kit (NDK).

    Table of contents

    1. Title Page
    2. Contents at a Glance
    3. Contents
    4. About the Author
    5. About the Technical Reviewer
    6. Acknowledgments
    7. Introduction
    8. Chapter 1: An Introduction to Game Development
      1. A Brief History of Video Games
      2. Who Makes Games?
      3. The Difference between Computer Games and Board Games
      4. Comparing Mobile Phones to Game Consoles
      5. An Overview of Game Engines
      6. Summary
    9. Chapter 2: An Introduction to the Android Game Development Ecosystem
      1. Java and the Dalvik Virtual Machine
      2. C++ and the NDK
      3. Fragmentation and the Android Ecosystem
      4. HelloDroid - Our First Android Game
      5. Summary
    10. Chapter 3: Game Design for Beginners: Droid Runner
      1. An Introduction to Design Documents
      2. Creating a World, Telling a Story, and Setting the Scene
      3. Level Design
      4. Technical Requirements
      5. Summary
    11. Chapter 4: Building a Game Engine
      1. Creating an Application Object
      2. Creating the Game Loop Using a Kernel and Tasks
      3. Android’s Native App Glue
      4. Timekeeping
      5. Summary
    12. Chapter 5: Writing a Renderer
      1. Initializing the Window and OpenGL Using EGL
      2. An Introduction to Shaders
      3. Rendering a Quad with OpenGL
      4. Applying Textures to Geometry
      5. Summary
    13. Chapter 6: Game Entities
      1. What Is a Game Entity?
      2. Communicating with Game Objects via Events
      3. Rendering an Object
      4. The Player Object
      5. Making the Player Jump
      6. A Basic AI Entity
      7. Summary
    14. Chapter 7: Building Game Levels with Collision
      1. Representing Game World Objects with Collision Data
      2. Building a Game Level
      3. Broad-Phase Filtering
      4. Narrow-Phase Collision Detection
      5. Responding to Collisions
      6. Running the Collision Test
      7. Using the Z Buffer
      8. Summary
    15. Chapter 8: Virtual Cameras
      1. The Model and View Matrices
      2. The Projection Matrix
      3. Defining a Camera Object
      4. Updating the Renderer
      5. Concatenating the Model, View, and Projection Matrices
      6. Updating the Camera’s Transform
      7. Adding a Camera to DroidRunnerLevel
      8. Proper App Behavior When Pausing and Resuming
      9. View Frustum Culling
      10. The View Frustum Culling Test
      11. Summary
    16. Chapter 9: Lighting and Materials
      1. A Basic Lighting and Material Model
      2. Per-Vertex or Per-Fragment Shading
      3. Representing Materials
      4. Ambient Lighting
      5. Vertex Normals
      6. Diffuse Lighting
      7. Specular Lighting
      8. Different Types of Lights
      9. Summary
    17. Chapter 10: Game Audio
      1. The Physics of Sound
      2. Audacity
      3. Creating a Jump Sound Effect with Audacity
      4. Playing Audio Using OpenSL ES
      5. Summary
    18. Chapter 11: Self-Publishing 101
      1. The Google Play Developer Console
      2. Keys, Keystore, and Digital Signatures
      3. Signing an APK for the Play Store
      4. Uploading to the Google Play Developer Center
      5. Monetization
      6. App Quality
      7. Summary
    19. Appendix A: Using the Android Development Environment
      1. Setting Up the Android SDK and Eclipse
      2. Installing the Android NDK
      3. Building a Native App
    20. Appendix B: Android Hardware Overview
      1. CPU Architectures
      2. GPU Architectures
    21. Appendix C: C++ Programming
      1. The Friend Keyword
      2. Templates
      3. The Singleton Pattern
    22. Appendix D: C++ Math
      1. Vectors
      2. Matrices
      3. Planes
    23. Index

    Product information

    • Title: Beginning Android C++ Game Development
    • Author(s):
    • Release date: August 2013
    • Publisher(s): Apress
    • ISBN: 9781430258308