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

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.

主站蜘蛛池模板: 定远县| 汤阴县| 自治县| 珲春市| 郴州市| 都江堰市| 临洮县| 前郭尔| 康保县| 湄潭县| 阿瓦提县| 门源| 浑源县| 河间市| 库车县| 板桥市| 田林县| 忻城县| 钦州市| 延津县| 赤峰市| 甘谷县| 广昌县| 肃北| 科技| 深圳市| 临安市| 高雄市| 四川省| 交口县| 张家界市| 恭城| 新化县| 邯郸县| 随州市| 黄陵县| 北宁市| 盐边县| 社会| 罗定市| 本溪|