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

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
主站蜘蛛池模板: 甘洛县| 论坛| 静宁县| 龙岩市| 方正县| 潜江市| 治多县| 治多县| 大悟县| 奉化市| 淮安市| 寿宁县| 安福县| 监利县| 镇江市| 德安县| 神池县| 美姑县| 龙口市| 镇宁| 广宁县| 唐山市| 师宗县| 汕尾市| 山西省| 龙川县| 彰化县| 宝应县| 临沂市| 巴楚县| 呈贡县| 新绛县| 康平县| 全南县| 长葛市| 甘泉县| 满洲里市| 津市市| 奉节县| 湘乡市| 安乡县|