- 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.
- Spring 5企業(yè)級(jí)開發(fā)實(shí)戰(zhàn)
- Getting Started with ResearchKit
- 動(dòng)手玩轉(zhuǎn)Scratch3.0編程:人工智能科創(chuàng)教育指南
- 數(shù)據(jù)庫(kù)系統(tǒng)原理及MySQL應(yīng)用教程
- Scratch 3游戲與人工智能編程完全自學(xué)教程
- HTML5+CSS3網(wǎng)站設(shè)計(jì)教程
- Mastering Python High Performance
- Unity 5.x By Example
- Linux命令行與shell腳本編程大全(第4版)
- Kotlin開發(fā)教程(全2冊(cè))
- JavaScript程序設(shè)計(jì)(第2版)
- Qlik Sense? Cookbook
- Python全棧開發(fā):基礎(chǔ)入門
- 游戲設(shè)計(jì)的底層邏輯
- The Python Apprentice