O'Reilly logo

Libgdx Cross-platform Game Development Cookbook by Alberto Cejas Sánchez, David Saltares Márquez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required