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

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
主站蜘蛛池模板: 五大连池市| 轮台县| 辽宁省| 界首市| 赤城县| 会同县| 民乐县| 新蔡县| 游戏| 泗阳县| 石河子市| 镇雄县| 淮滨县| 承德市| 炎陵县| 元江| 万载县| 务川| 吉林省| 永福县| 崇信县| 和硕县| 英超| 壶关县| 蒲江县| 庆城县| 雷山县| 灵武市| 馆陶县| 朝阳区| 鹿泉市| 七台河市| 九江市| 汝南县| 和林格尔县| 尉氏县| 桐乡市| 本溪市| 阜康市| 广灵县| 定边县|