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

Chapter 4. Adding Controls

Players control mobile games through a very limited number of interactions. Often, games feature only a single mechanic: tap anywhere on the screen to jump or fly. Contrast that with a console controller with dozens of button combinations. With so few actions, keeping users engaged with polished, fun controls is vital to the success of your game.

In this chapter, you will learn how to implement several popular control schemes that have emerged from the App Store. First, we will experiment with tilt controls; the physical orientation of the device will determine where the player flies. Then, we will wire up the onTap events on our sprite nodes. Finally, we will implement and polish a simple control scheme for flying in our game: tap anywhere on the screen to fly higher. You can combine these techniques to create unique and enjoyable controls in your future games.

The topics in this chapter include the following:

  • Retrofitting the Player class for flight
  • Polling for device movement with Core Motion
  • Wiring up the sprite on Tap events
  • Teaching our penguin to fly
  • Improving the camera
  • Looping the ground as the player moves forward
主站蜘蛛池模板: 鄂托克旗| 清镇市| 岳池县| 海兴县| 华容县| 胶南市| 清水县| 新泰市| 双江| 安义县| 南部县| 香港 | 乐至县| 三明市| 屯昌县| 宝鸡市| 辛集市| 肥乡县| 孟连| 安岳县| 芦溪县| 灵丘县| 宁武县| 茶陵县| 昌邑市| 凤阳县| 金秀| 蒲城县| 东莞市| 安阳市| 阿拉善盟| 米脂县| 西宁市| 紫金县| 庄浪县| 体育| 平昌县| 大厂| 赤城县| 凤山县| 临漳县|