- 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.
- Python計(jì)算機(jī)視覺編程
- Kali Linux Wireless Penetration Testing Beginner's Guide(Third Edition)
- Python面向?qū)ο缶幊蹋簶?gòu)建游戲和GUI
- 零基礎(chǔ)輕松學(xué)SQL Server 2016
- Lighttpd源碼分析
- PHP從入門到精通(第4版)(軟件開發(fā)視頻大講堂)
- Mastering Linux Security and Hardening
- Python深度學(xué)習(xí)原理、算法與案例
- Geospatial Development By Example with Python
- C#面向?qū)ο蟪绦蛟O(shè)計(jì)(第2版)
- C語言從入門到精通(視頻實(shí)戰(zhàn)版)
- Game Development Patterns and Best Practices
- Building E-Commerce Solutions with WooCommerce(Second Edition)
- 亮劍C#項(xiàng)目開發(fā)案例導(dǎo)航
- MATLAB/Simulink建模與仿真