Gamepad Input: Duet for Two
In this chapter, you'll play Duet with two people and two game controllers. The big idea is the gamepad: how to read sticks and buttons, and how to turn the keyboard, a gamepad, and a touch screen into the same simple number that drives a robot.
I'm still writing this chapter, step by step. In the meantime, you can play the finished game, and read the code and the assets that make it, so that you can run it and change it yourself.
Play the Game
The code that makes it:
The assets, which go in an assets folder next to the game: