Book Image

Creative Greenfoot: RAW

By : Michael Haungs
Book Image

Creative Greenfoot: RAW

By: Michael Haungs

Overview of this book

Table of Contents (17 chapters)
Creative Greenfoot
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 9. Gamepads in Greenfoot

 

"Only you can control your future."

 
 --Dr. Seuss

In this chapter, we will cover how to connect and use gamepad controllers in your Greenfoot scenarios. The set of controls you provide to your user really has an impact on their experience. Imagine playing our version of Avoider Game, which we created in the first two chapters of this book, if you had to hit U to move up, D to move down, L to move left, and R to move right. In the same way that a bad layout can frustrate a user, a good layout can feel very natural.

Gamepads are designed to heighten the experience of playing games. They provide a natural and expedient way for players to express their decisions to the game without detracting from game play. Early in gaming history, gamepads took the form of simple joysticks with a single button to fire with. Today, typical controllers have over 10 buttons, analog sticks, analog triggers, and a digital D-pad. Many controllers often allow the user to build custom...