O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering AndEngine Game Development

Book Description

Move beyond basic games and explore the limits of AndEngine

About This Book

  • Extend the basic AndEngine features without modifying any of AndEngine's code
  • Understand advanced technologies and gain the skills to create the ultimate games in AndEngine
  • Theory supported with practical examples to stimulate your imagination and creativity

Who This Book Is For

This book is aimed at developers who have gone through all the basic AndEngine tutorials and books, and are looking for something more. It's also very suitable for developers with knowledge of other game engines who are looking to develop with AndEngine. Knowledge of Java, C++ and Android development are a prerequisite for getting the most out of this book.

What You Will Learn

  • Extend AndEngine to use and render 3D models
  • Integrate and use various physics engines with AndEngine
  • Advanced animations and their implementation in AndEngine
  • Lighting theory and its application for both 2D and 3D objects
  • Using skeletal animation with AndEngine
  • Use GLSL shaders with AndEngine for effects and anti-aliasing
  • Add sounds and effects to AndEngine using both basic and 3D audio libraries
  • Efficient network implementations with AndEngine for multi-players

In Detail

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.

Style and approach

This book takes an in-depth tour of the many aspects of Android game development with the use of AndEngine. Each topic is covered extensively to act both as a practical guide as well as a reference.

Table of Contents

  1. Mastering AndEngine Game Development
    1. Table of Contents
    2. Mastering AndEngine Game Development
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Setting Up the Project
      1. Project requirements
      2. Application basics
      3. Creating the scene
      4. Running Android applications
      5. Debugging
      6. Our goals
      7. Summary
    9. 2. Replacing 2D Sprites with 3D Models
      1. Why 3D in a 2D game makes sense
      2. 2D and 3D compared
      3. Dealing with the third dimension
      4. Setting up the environment
      5. Importing a model
        1. Building our library
      6. Basic Android OpenGL ES
        1. MainActivity
        2. ModelData
        3. Renderer
        4. Scene
        5. Camera
        6. ShaderProgram
        7. Mesh
        8. Actor
      7. Adding 3D models to AndEngine
        1. MainActivity
        2. Scene3D
        3. ShaderProgram3D
      8. The result
      9. Summary
    10. 3. Physics Engine Integration
      1. Integrating physics with AndEngine
      2. Integrating Box2D
        1. MainActivity.java
        2. Actor3D.java
      3. A discussion on 2D physics
      4. Summary
    11. 4. Frame-based Animation Sequences
      1. Different frame types
      2. Sprite sheets
        1. Full sequence
        2. AnimationPack
        3. The key frame sequence
        4. Object-based animations
        5. Universal Tween Engine
      3. Summary
    12. 5. Skeletal Animations
      1. Bones and joints
        1. Defining bones
        2. Defining joints
      2. Animating
        1. Inverse kinematics
        2. Forward kinematics
        3. Limits (constraints)
        4. Rigging
      3. Skinning
      4. 3D skeletal animation
      5. Key frames and interpolation
        1. Applying transformations
        2. Interpolation types
      6. 2D skeletal animation
      7. Loading skeletal animations
        1. FBX
        2. Assimp
        3. Spine
        4. Spriter
      8. Morph target animation
      9. Summary
    13. 6. Creating 3D Effects in 2D
      1. Perspective
        1. Zero-point perspective
        2. Rotation
        3. AndEngine rotation example
      2. Parallax
        1. Parallax scrolling with AndEngine
      3. Axonometric and oblique projection
        1. AndEngine isometric projection (TMX)
      4. Shadows
      5. Summary
    14. 7. Static Lighting
      1. Defining lighting
      2. 2D static lighting
      3. 3D static lighting
      4. The benefits of static lighting and shadows
      5. Lightmaps
        1. Baking lightmaps
      6. Shadow mapping
      7. Shadow volumes
      8. Lights
      9. Common AndEngine lighting effects
      10. Summary
    15. 8. Dynamic Lighting
      1. Making lighting dynamic
      2. Dynamic 2D lighting
        1. Ambient lighting
        2. Edge (rim) lighting
          1. Normal mapping
      3. Dynamic 3D lighting
        1. Lightmaps
        2. Shadow mapping
        3. Shadow volumes
      4. Cheap dynamic shadows
      5. Reflections
      6. Combining static and dynamic lighting
      7. Summary
    16. 9. User Interfaces
      1. Menu systems
        1. Submenus
        2. Dynamic text-based menus
        3. The on-screen user interface
      2. Visual matching
      3. Controls
        1. Motion
        2. Touch
        3. Digital control
        4. Analog control
      4. Text input
      5. Summary
    17. 10. Shading, Aliasing, and Resolutions
      1. Handling different resolutions
        1. Picking a policy
        2. Obtaining display details
      2. OpenGL ES shaders
      3. Adding anti-aliasing
      4. Summary
    18. 11. Adding Sounds and Effects
      1. AndEngine's sound classes
        1. The SoundPool implementation
        2. The SoundManager wrapper
      2. OpenSL ES
        1. Manual OpenSL ES usage
      3. OpenAL
      4. Positional audio
      5. Sound effects
        1. Reverb
      6. Managing audio resources
      7. Summary
    19. 12. Building Worlds for Our Project
      1. Scene managers
        1. The implementation
        2. The scene file format
        3. Text-based scene files
          1. Parsing and scene construction
        4. INI-format-based scene files
        5. TMX tile maps
        6. Resource management
      2. Transitions
        1. Scene-manager-based transition
      3. Backgrounds
      4. Hierarchies
      5. Constraints
      6. Summary
    20. 13. Networking and Latency
      1. Network types
      2. Using a network
        1. Ensuring a network is available
      3. Latency compensation
        1. Server-side lag
          1. Do nothing
          2. Complete synchronization
        2. Relying on client extrapolation
        3. Hybrid
      4. Multiplayer implementations
        1. Real-time multiplayer
        2. Server-based
        3. Peer-to-peer
        4. Hybrid
      5. AndEngine's multiplayer extension
        1. Sending a message
        2. Bluetooth-based
      6. Summary
    21. 14. Adding Custom Functionality
      1. The point of noninvasive additions
      2. Extending classes
        1. Limitations
        2. Using native code
      3. A plugin system
        1. Native plugins
        2. A native plugin system
        3. Loading/unloading libraries
      4. Summary
    22. Index