Killer Game Programming in Java

The User Interface

Maze3D invokes MazeManager, BirdsEye, SecondViewPanel, and WrapMaze3D objects. The latter three are subclasses of JPanel, which Maze3D organizes using the layout shown in Figure 25-6.

Figure 25-6. Maze3D GUI layout

The fragment of code below contains the invocation of these four objects and shows that MazeManager is required by all the JPanel objects:

MazeManager mm = new MazeManager(fnm); // fnm holds maze plan BirdsEye be = new BirdsEye(mm); SecondViewPanel secondVP = new SecondViewPanel(mm); WrapMaze3D w3d = new WrapMaze3D(mm, be, secondVP.getCamera2TG( ) );

The GUI is made with the BirdsEye object (the bottom-right panel in Figure 25-6), the SecondViewPanel object (the top-right panel in Figure 25-6), and the WrapMaze3D object (the lefthand panel).

Категории