Computer Science 486 Mobile and Internet Game Development

Study Guide :: Unit 2

First Android Game Development—Tappy Defender

Overview

This unit will guide you through developing a simple Android game, Tappy Defender, where you will fly a spaceship in Flappy-Bird style, with one finger to reach home planet, while avoiding multiple enemies. By developing this game, you will learn about how to apply basic animation, home screen, collision detection, high scores, simple heads-up display (HUD), one-finger touchscreen control, and sound FX.


Learning Objectives

After completing this unit, you will be able to:

  • Handle the Android Activity lifecycle to make a simple Android application.
  • Describe the Android Studio file structure.
  • Prepare a game plan and use design patterns to develop a simple game engine.
  • Set up a game’s code structure, game loop, and threat.
  • Draw objects and animate them on the screen.
  • Detect touches and control characters on the screen.
  • Configure the AndroidManifest.xml file.
  • Incorporate simple intelligence in the game characters.
  • Describe and implement simple collision-detection algorithms.
  • Draw a heads-up display (HUD) to show the player in-game information.
  • Generate your own sound FX and add them to the game.

Learning Activities

  • Read Unit 2 notes.
  • Read the following chapters in the textbook, Android Game Programming by Example.
    • Tappy Defender—First Step
    • Tappy Defender—Tacking Flight
    • Tappy Defender—Going Home
  • Read the review questions below in this unit and use the course discussion forum to:
    • Post your answer to any one of the review questions.
    • Comment on another student's posted answer.
    • Answer any questions posed to you.
  • Do the unit exercise, discuss it with your Academic Expert, and share your experience with your peers on the discussion board.

Lesson Notes

  1. Tappy Defender—First Step

    This lesson describes the basic structure of the code, including an approximate design pattern that is used to develop the Tappy Defender game. It also discusses the skeleton of the game engine that is used for the Tappy Defender game development. At the end of this lesson, a real object (spaceship) is drawn and animated on the screen.

  2. Tappy Defender—Taking Flight

    This lesson shows how the dealing of multiple objects, player controls of game characters, and scrolling stars in the background have been done in the Tappy Defender game. It also discusses different collision-detection methods and illustrates an efficient solution for the Tappy Defender game.

  3. Tappy Defender—Going Home

    This lesson describes how some additional features such as HUD, high score, sound FX, and victory conditions have been added in the Tappy Defender game.


Review Questions

  1. What are the core building blocks of Android? Explain?
  2. What is the AndroidManifest.xml file and how is it used? Why are the roles of activity_main.xml and MainActivity.java files in Android application development?
  3. What are different storages available in Android? What items or folders are important in every Android project? What are containers and App Widgets?
  4. Explain some techniques that can induce intelligence in the game characters?
  5. What do High Score and HUD represent in a game? What information you are planning to include in HUD for your mobile game?
  6. What is activity? What are the life-cycle methods of android activity?
  7. What is collision detection? What collusion detection method you think is more suitable for your mobile game development project?
  8. What different touch gestures can be detected by Android APIs?
  9. Explain the APIs that are associated with detecting common gestures and handling multi-touch gestures in Android.
  10. How do you play a sound effect in an Android game?

Unit Exercise

  1. Implement the Tappy Defender game by following the instructions and the codes provided in the textbook. Review and analyze the codes and different functionalities of the Tappy Defender game for a better understanding. In the respective unit forum, post your experience and discuss items that you found useful.