Chapter 10: Using the Mouse and Keyboard

"Now press any key; where's the 'any' key?"
—Homer Simpson

Introduction

The ability to read input into a program is a major step in the process of creating Java games. In this chapter we first of all use some simple examples to show how keyboard and mouse events are read into an applet and application, respectively, and then we look at some more advanced techniques for reading the input. In the previous chapter we learned how to display graphics, which together with the subject of this chapter gives us the ability to make real-time games.



Java 1.4 Game Programming
Java 1.4 Game Programming (Wordware Game and Graphics Library)
ISBN: 1556229631
EAN: 2147483647
Year: 2003
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net