Implementing input handling for player character movement

Our final class that we need to implement for this chapter is PlayerController. PlayerController is responsible for handling all of the input events and providing mechanisms to process these events in the queue. This class can be found at core/src/com/packtpub/libgdx/bludbourne/PlayerController.java.

PlayerController

A class diagram of this class is shown in the following screenshot (Figure 14):

PlayerController

Figure 14

The source for PlayerController is listed here:

package com.packtpub.libgdx.bludbourne; import java.util.HashMap; import java.util.Map; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; ...

Get Mastering LibGDX Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.