官术网_书友最值得收藏!

Chapter 1. Setting Up the Project

In this chapter, we will describe the situations in which it makes sense to use the Android SDK for a game and those where it is best to use an external engine, explaining the pros and cons of each case.

We will create a simple project that we will be improving throughout the book, until it becomes a complete game. The particular game we are going to build is a Space Shooter.

A few top-level decisions will be made and explained, such as which orientation to use and how are we going to use activities and fragments.

We will describe the top-level architecture of a game engine, study how it is different from a typical app's, explaining why there is an UpdateThread and how it interacts with the user input and why it is separated from the DrawThread; we will include those elements in our project.

Once the game engine is completed, we will expand the project to show a pause dialog, handle the Android back key properly, be consistent with the Activity lifecycle, and make it fullscreen.

Finally, we will summarize some best practices in writing code for games.

Topics that will be covered in this chapter are as follows:

  • The right tool for the right game
  • Setting up the project with Android Studio
  • Game architecture
  • Alert dialogs
  • Handling the back key
  • Dealing with the fullscreen mode
  • Good practices for game developers
主站蜘蛛池模板: 南宫市| 桐庐县| 大英县| 厦门市| 文化| 吉安县| 清水河县| 韩城市| 长丰县| 林州市| 娄烦县| 紫金县| 巧家县| 望奎县| 汨罗市| 合水县| 大安市| 长泰县| 梁平县| 灵宝市| 大方县| 成都市| 金平| 固安县| 灌云县| 黑龙江省| 九江市| 新民市| 西乌珠穆沁旗| 陈巴尔虎旗| 本溪| 商洛市| 海晏县| 从化市| 茶陵县| 余姚市| 大化| 英山县| 绍兴市| 屯门区| 马山县|