- Mastering Android Game Development
- Raul Portales
- 203字
- 2021-07-16 13:59:08
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.
- Learning Microsoft Windows Server 2012 Dynamic Access Control
- 高手是如何做產品設計的(全2冊)
- 數字媒體應用教程
- Objective-C應用開發全程實錄
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Java完全自學教程
- Python自動化運維快速入門
- 深入淺出WPF
- Mastering Spring MVC 4
- Python神經網絡項目實戰
- 高級C/C++編譯技術(典藏版)
- Visual C#.NET程序設計
- 劍指MySQL:架構、調優與運維
- Visual Basic程序設計
- 開源項目成功之道