Chapter 4. Detecting User Input

In this chapter, we will cover the following recipes:

  • Detecting user input via event polling
  • Detecting user input via event listening
  • Managing multiple listeners at once
  • Detecting more complex gestures
  • Introducing the controllers API
  • Input mapping for cross-platform development

Introduction

Games are fundamentally different from other kinds of modern media: they are interactive. The player adopts an active role and jumps into the action of what is happening on the other side. This is a true marvel and one of the reasons why people feel so engaged.

For a game to be enjoyable, interaction needs to be seamless and fluid. The user should not feel a barrier or any disconnection between what they want to do and what actually happens. Good controls are required for your game to succeed!

Throughout this chapter, we will discuss the myriad of ways to detect user input within Libgdx and the extra utilities you can use to make your life easier.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.12.207