Killer game programming in Java
Although the number of commercial Java games is still small compared to those written in C or C++, the market is expanding rapidly. Recent updates to Java make it faster and easier to create powerful gaming applications-particularly Java 3D-is fueling an explosive growth in Java games. Java games l...
Autor principal: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Beijing ; Sebastopol, California :
O'Reilly Media
2005.
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009626948906719 |
Tabla de Contenidos:
- Table of Contents; Preface; Who Are You?; What This Book Is About; This Book (and More) Is Online; What This Book Is Not About; A Graphical View of This Book; 2D Programming; 3D Programming; Network Programming; The Appendixes; Conventions Used in This Book; Using Code Examples; Comments and Questions; Safari Enabled; Acknowledgments; Why Java for Games Programming?; Java Is Too Slow for Games Programming; Swing Is Slow; My Program Is Slow Because of Java; Java Has Memory Leaks; Java Is Too High-level; Java Application Installation Is a Nightmare; Java Isn't Supported on Games Consoles
- No One Uses Java to Write Real GamesFreeware/Shareware Games; Sun Microsystems Isn't Interested in Supporting Java Gaming; An Animation Framework; Animation as a Threaded Canvas; Synchronization Concerns; Application and Game Termination; Why Use Volatile?; Why Sleep?; Double Buffering Drawing; Adding User Interaction; Converting to Active Rendering; FPS and Sleeping for Varying Times; Timer Resolution; Am I Done Yet? (Nope); Improved J2SE Timers; Using Non-J2SE Timers; Measuring Timer Resolution; Java 3D Timer Bug Alert; Sleeping Better; Handling Sleep Inaccuracies; FPS and UPS
- Separating Updates from RenderingPausing and Resuming; Other Animation Approaches; Swing Timer Animation; The Utility Timer; Worms in Windows and Applets; Preliminary Considerations; The Choice of Timer; Class Reuse; Testing for Speed; Class Diagrams for the WormChase Application; The Worm-Chasing Application; The Game Panel; User Input; The Animation Loop; Statistics Gathering; Drawing the Canvas; Storing Worm Information; Growing a Worm; Calculating a New Head Point; Choosing a Bearing; Dealing with Obstacles; Moving the Worm; Drawing the Worm; Testing the Worm; Worm Obstacles
- Application Timing ResultsTiming Results Using currentTimeMillis(); WormChase as an Applet; The WormChaseApplet Class; The WormPanel Class; Timing Results; Compilation in J2SE 5.0; What Is a Type-Safe Collection?; Dealing with Raw Types in J2SE 5.0; Full-Screen Worms; An Almost Full-Screen (AFS) Worm; The AFS WormChase Class; Stopping Window Movement; Timings for AFS; An Undecorated Full-Screen (UFS) Worm; The UFS WormChase Class; The Game Panel; Button Behavior; Drawing the Game Canvas; Exiting the Game; Timings for UFS; A Full-Screen Exclusive Mode (FSEM) Worm; The FSEM WormChase Class
- Setting Up Full-Screen Exclusive ModeDouble Buffering, Page Flipping, and More; Rendering the Game; Finishing Off; Displaying the Display Mode; Changing the Display Mode; Timings for FSEM; Timings at 80 to 85 FPS; An Introduction to Java Imaging; Image Formats; The AWT Imaging Model; The MediaTracker Class; ImageIcon; The Rise of JARs; AWT Image Processing; An Overview of Java 2D; The Graphics2D Class; Java 2D and Active Rendering; Buffering an Image; From Image to BufferedImage; The Internals of BufferedImage; BufferedImageOp Operations; Managed Images; VolatileImage; Java 2D Speed
- Portability and Java 2D