Debugging Harbor Defender

With a simple approach to how the game looks, you’re ready to try it. Load it as you would any game, and you see boats slowly appear and cruise down toward the castle. If you wait long enough, they pass through the castle and off the screen.

If things don’t work this way, or you get an error like the one displayed in Figure 8-8, or the game closes at startup, then you have some work to do. This section is dedicated to fixing common problems in game development for Android. It doesn’t go into specific problems because there is no way to anticipate every error. It should be fairly obvious how to fix errors in your code if Eclipse catches them, but the runtime issues can be more difficult.

Here is the process to use:

Get Beginning Android Tablet Games Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.