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

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
主站蜘蛛池模板: 虹口区| 赤水市| 亚东县| 溧阳市| 酒泉市| 长沙市| 临清市| 额济纳旗| 阜城县| 榆林市| 崇州市| 土默特左旗| 项城市| 东源县| 平邑县| 孟村| 麻城市| 阳城县| 双峰县| 招远市| 温泉县| 绥化市| 陆河县| 锡林郭勒盟| 永修县| 梓潼县| 双江| 莒南县| 郸城县| 富锦市| 应城市| 东安县| 五指山市| 宜良县| 安溪县| 武宁县| 江北区| 年辖:市辖区| 昆明市| 团风县| 滨州市|