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

Mobile Input/Touch Controls

How players interact with your project is probably one of the most important things that can be established as a part of your project. While player input is added for all projects, no matter what platform you are using, this is also one area that can make or break your mobile game.

If the controls that are implemented don't fit the game that you're making, or if the controls feel clunky, players will not play your game for long stretches of time. While many people consider Rockstar's Grand Theft Auto series of games to be great on console and PC, playing the game on a mobile device provides a larger barrier of entry, due to all of the buttons on the screen and replacing joysticks with virtual versions that don't have haptic feedback in the same manner as on other platforms.

Mobile and tablet games that tend to do well typically have controls that are simple, finding as many ways to streamline the gameplay as possible. Many popular games require a single input, such as Dong Nguyen's Flappy Bird and Ketchapp's Ballz

There are many different ways for games to interact with a mobile device that are different than for traditional games, and we will explore a number of those in this chapter.

In this chapter, we will cover the different ways that inputs will work on mobile devices. We will start off with the input that is already built into our project using the mouse, and then move on to touch events, gestures, using the accelerometer, and accessing information via the Touch class.

This chapter will be split into a number of topics. It will contain a simple, step-by-step process from beginning to end. Here is the outline of our tasks:

  • Using mouse input for mobile input
  • Movement via touch
  • Implementing a gesture
  • Scaling the player using pinches
  • Using the accelerometer
  • Reacting to touch
主站蜘蛛池模板: 平昌县| 铜川市| 新竹县| 柏乡县| 庆云县| 诏安县| 楚雄市| 多伦县| 红河县| 平定县| 樟树市| 丘北县| 根河市| 来宾市| 鸡泽县| 瑞安市| 临桂县| 油尖旺区| 临澧县| 仲巴县| 中江县| 新营市| 永仁县| 武威市| 红桥区| 宝应县| 嫩江县| 汤阴县| 沂水县| 武陟县| 江阴市| 宿迁市| 松阳县| 望都县| 陆良县| 武城县| 游戏| 三河市| 南江县| 义乌市| 象州县|