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

Chapter 2. Managing User Input

In this chapter, we will learn how to handle user input in a generic way and later expand it to be either a virtual joystick, sensors, or an external controller.

To get a visual feedback of the input, we will be placing a spaceship on the screen and moving it around. We will also make it fire some bullets. This will also help you understand the interaction between the game objects and the game engine.

We will extend the generic InputController class to make the simplest keypad controller possible to understand how the class fits in the existing architecture and how the input is processed and read inside the game objects.

Once we get the basic keypad working, we will implement a virtual joystick, which is a much better way of handling user input.

Managing physical controllers is also important for the game we are writing, so we will see how to detect them and handle different options.

Finally, we will talk a bit about using sensors as controls. They are not a good fit for this type of game, but we will cover the basics and provide some links if you want to explore further.

主站蜘蛛池模板: 姚安县| 辽阳市| 嘉峪关市| 若尔盖县| 德江县| 秭归县| 台东县| 福州市| 彩票| 集安市| 钟山县| 惠来县| 汶川县| 昌邑市| 松江区| 涟水县| 六枝特区| 岳阳县| 民县| 石景山区| 涿州市| 万全县| 黔江区| 延川县| 建昌县| 武定县| 和静县| 鸡泽县| 新营市| 浙江省| 蒙山县| 鄂伦春自治旗| 府谷县| 兴化市| 云和县| 安陆市| 鲁山县| 稻城县| 靖州| 三穗县| 长海县|