A popular aim for games is an immersive experience, where the player becomes so enthralled with the game that he/she forgets everyday trivia such as eating and visiting the bathroom. One simple way of encouraging immersion is to make the game window the size of the desktop: a full-screen display effectively hides tiresome text editors, spreadsheets, or database applications requiring urgent attention.
We'll look at three approaches to creating full-screen games:
FSEM is getting a lot of attention since its introduction in J2SE 1.4, because it offers greatly increased frame rates over traditional gaming approaches using repaint events and paintComponent(). However, timing comparisons between AFS, UFS, and FSEM reveal surprisingly little disparity between them, due to our use of the animation loop developed in chapter 1 with its active rendering and high resolution Java 3D timer. I won't be explaining those techniques again, so chapter 2 should be read before you start here.
The examples in this chapter will continue using the WormChase game, first introduced in in chapter 3 (so you'd better read that chapter as well). By sticking to a single game throughout this chapter, and the last, timing comparisons more accurately reflect differences in the animation frameworks rather than in the game-specific parts.
The objective is to produce frame rates in the range 80-85 FPS, which is near the limit of a typical graphics card's rendering capacity. If the game's frame rate falls short of this, then its updates/second (UPS) should still stay close to 80-85, causing the game to run quickly, but without every update being rendered.