Book Image

Android Game Programming by Example

By : John Horton
Book Image

Android Game Programming by Example

By: John Horton

Overview of this book

Table of Contents (18 chapters)
Android Game Programming by Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
7
Platformer – Guns, Life, Money, and the Enemy
Index

Chapter 5. Platformer – Upgrading the Game Engine

Welcome to the second project of this book. Here, we will build a really tough retro platform game. It is not tough to build, but tough to beat when you play it. At the end of the project, we will also discuss ways to make the game play a little less punishing should you wish.

This chapter will focus entirely on our game engine and essentially lead to an upgraded version of the Tappy Defender code.

First, we will discuss what we want to achieve with this game: the backstory, game mechanics, and rules.

Then, we will quickly create an activity that instantiates a view that will do all the work.

After that, we will flesh out the basic structure of our PlatformView class, which will have some subtle, but important differences to our TDView class. Most notably, PlatformView will have a simple but effective way of managing the timing of all the events of our game.

We will then start the iterative process of building our GameObject class, from which...