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

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.

主站蜘蛛池模板: 台南市| 汶上县| 林州市| 鹤岗市| 杭州市| 开化县| 西吉县| 泸西县| 绵竹市| 汨罗市| 弥渡县| 毕节市| 广丰县| 冀州市| 綦江县| 北票市| 贵定县| 沽源县| 宜都市| 吉林市| 合山市| 祁门县| 红河县| 清镇市| 依安县| 肥乡县| 赣榆县| 长顺县| 图木舒克市| 汪清县| 淄博市| 宜川县| 遵化市| 洮南市| 阳山县| 咸阳市| 华坪县| 壤塘县| 炎陵县| 桂林市| 乐东|