Get ready for a fun-filled experience of learning Java by developing games for the Android platform About This Book Acquaint yourself with Java and object-oriented programming, from zero previous experience Build four cool games for your phone and tablet, from retro arcade-style games to memory and education games, and gain the knowledge to design and create your own games too Walk through the fundamentals of building games and use that experience as a springboard to study advanced game development or just have fun Who This Book Is For If you are completely new to either Java, Android, or game programming and are aiming to publish Android games, then this book is for you. This book also acts as a refresher for those who already have experience in Java on another platforms or other object-oriented languages. In Detail Android is the fastest growing operating system (OS) with one of the largest installed bases of any mobile OS. Android uses one of the most popular programming languages, Java, as the primary language for building apps of all types. So, you should first obtain a solid grasp of the Java language and its foundation APIs to improve the chances of succeeding as an Android app developer. This book will show you how to get your Android development environment set up and you will soon have your first working game. The difficulty level grows steadily with the introduction of key Java topics such as loops, methods, and OOP. You'll then use them in the development of games. You will learn how to build a math test game, a Simon-like memory game, a retro pong-style game, and for the grand finale, a Snake-style, retro arcade game with real Google Play leaderboards and achievements. The book has a hands-on approach and is packed with screenshots.
Table of Contents Java, Android & Games Java Basics & An Introduction to Object Oriented Programming - Starting the Sub Hunter Game Java Variables, Operators, Expressions and Android Debugging - Spawning a Sub to Hunt Making Decisions with Java If, Else & Switch - Getting the Player's Input The Android Canvas Class, Drawing to The Screen - Firing Depth Charges While, Do While, For Loops, Break & Continue - Enhancing Sub Hunter Game Java Methods - Finishing Sub Hunter Game Object Oriented Programming - Starting the Pong Game Interfaces, Threads & Exceptions - Coding the Pong Game Loop Coding a class for the player's bat & Handling Input Collisions, Sound FX and Supporting Different Android Versions - Finishing the Pong Game Handling LOTS of Objects with Arrays - Welcome to Bullet HELL Drawing with Bitmap Graphics - Coding the Player and Finishing the Game Java Collections, The Stack, the Heap & Garbage Collection - Starting the Snake Game Using Java Enumerations - Building the Snake Class Android Localization, Hola! - Building a Retro Game Loop Finishing the Snake Game More Advanced OOP using Inheritance, Polymorphism & the Entity Component Pattern - Starting the Scrolling Shooter Game Managing Sound Better & Pausing the Game Coding The player's ship and Scrolling Stars Persisting Data & Finishing the Game Using More Advanced OOP with Singleton Pattern & the AssetManager Class - Starting the Platformer Game Viewing Huge Worlds Through a Camera Improving Performance with Object Pools & Animating with Sprite Sheets - Adding Enemies and Bullets Handling Multiple Screens & Communicating Between Objects - Finishing the Platform Game What next