HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.
This is the Rough Cut version of the printed book.
Build the Next Great Android Game!
Learning Android Game Programming is your hands-on, start-to-finish guide to creating winning games for today’s rapidly growing Android mobile device marketplace. If you have even basic Android development experience, Rick Rogers will help you build on your knowledge to quickly create low-budget 2D mobile games that sell.
The book starts with an up-to-the-minute overview of today’s Android mobile games marketplace, reviews each leading genre, and teaches you the foundational concepts of game development. You’ll design a simple game, then master every step of game development with AndEngine—the powerful, open source, free game-development engine. Every chapter teaches with sample code you can actually use, including many examples drawn from the published game, Virgins Versus Vampires (V3).
With this book you’ll learn how to
Download the free version of Virgins Versus Vampires (V3) from Android Market today, as you learn how to build the game in this book
Foreword xix
Preface xxi
Acknowledgments xxiii
About the Author xxv
Chapter 1: Mobile Games 1
The Mobile Game Market 1
The World of Computer Games 2
AndEngine Examples 10
Summary 12
Exercises 12
Chapter 2: Game Elements and Tools 15
Software Development Tools 15
Graphics Tools 20
Audio Tools 24
Getting Our Feet Wet: The Splash Screen 26
Summary 31
Exercises 32
Chapter 3: The Game Loop and Menus 33
Game Loops in General 33
The Game Loop in AndEngine 34
Adding a Menu Screen to V3 37
Memory Usage 50
The Quit Option 51
Summary 51
Exercises 52
Chapter 4: Scenes, Layers, Transitions, and Modifiers 53
Scenes in AndEngine 53
Creating the Game Level 1 Scene 79
Summary 85
Exercises 85
Chapter 5: Drawing and Sprites 87
Quick Look Back at Entity 87
Drawing Lines and Rectangles 88
Sprites 89
Summary 106
Exercises 107
Chapter 6: Animation 109
Requirements for Animation 109
Animation Tiled Textures 110
Animation in AndEngine 111
Animation Example 113
Adding Animation to Level1Activity 118
Animation Problems 126
Advanced Topic: 2D Animations from 3D Models 127
Summary 127
Exercises 128
Chapter 7: Text 129
Fonts and Typefaces 129
Loading Fonts 130
Text in AndEngine 133
Custom Fonts 137
Adding Custom Fonts to V3 139
Summary 146
Exercises 146
Chapter 8: User Input 149
Android and AndEngine Input Methods 149
Adding User Input to V3 167
Summary 171
Exercises 172
Chapter 9: Tile Maps 173
Why Tile Maps? 173
Types of Tile Maps 173
Structure of Tile Maps 176
Tile Maps in AndEngine 176
The Tile Editor: Tiled 179
TMX Files 180
Orthogonal Game: Whack-A-Vampire 181
Isometric Tile Maps 196
Summary 197
Exercises 197