E continuo me divertindo com o jpct ! agora estou quase entendendo alguns trechos do código hehehe, mas para minha satisfação consegui isolar o código para um possível jogo em um JComponent e fiz alguns ajustes para permitir rodar tanto num Applet quanto num JFrame.

clique aqui para ver o resultado final

clique em veja mais para ver o código fonte

Load3DSApplet.java
01 import java.io.InputStream;
02 import java.net.URL;
03
04 import javax.swing.JApplet;
05
06 public class Load3DSApplet extends JApplet implements Runnable, Pathbuilder {
07
08 private static final long serialVersionUID = 1L;
09
10 private Load3DSGame game = null;
11
12 public void start() {
13 try {
14 game = new Load3DSGame(this, this);
15 game.finishOnESC(false);
16 getContentPane().add(game);
17
18 Thread gamethread = new Thread(this);
19 gamethread.start();
20 } catch (Exception e) {
21 System.err.println("Initialization failed");
22 e.printStackTrace();
23 }
24 }
25
26 public void run() {
27 game.play();
28 }
29
30 public InputStream createPath(String fileName) throws Exception {
31 System.out.println("createPath() filename=" + fileName);
32 URL url = new URL(getDocumentBase(), fileName);
33 InputStream in = url.openStream();
34 return in;
35 }
36
37 public void destroy() {
38 game.exit();
39 }
40
41 public void stop() {
42 game.exit();
43 }
44
45 }
Load3DSFrame.java
01 import java.awt.BorderLayout;
02 import java.awt.Label;
03 import java.io.FileInputStream;
04 import java.io.InputStream;
05
06 import javax.swing.JFrame;
07
08 public class Load3DSFrame extends JFrame implements Pathbuilder, Runnable {
09
10 private static final long serialVersionUID = 1L;
11
12 private Load3DSGame game;
13
14 public static void main(String[] args) throws Exception {
15 Load3DSFrame frame = new Load3DSFrame();
16 frame.setVisible(true);
17 }
18
19 public Load3DSFrame() throws Exception {
20 game = new Load3DSGame(this, this);
21 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
22 setTitle("Game Frame");
23 setSize(800, 600);
24 setResizable(false);
25 setLocationRelativeTo(null);
26
27 getContentPane().add(game, BorderLayout.CENTER);
28 getContentPane().add(new Label("this is a label"), BorderLayout.SOUTH);
29
30 Thread gamethread = new Thread(this);
31 gamethread.start();
32
33 }
34
35 public InputStream createPath(String fileName) throws Exception {
36 System.out.println("createPath() filename=" + fileName);
37 FileInputStream in = new FileInputStream(fileName);
38 return in;
39 }
40
41 public void run() {
42 game.play();
43 }
44
45 }
Load3DSApplet.java
01 import java.io.InputStream;
02 import java.net.URL;
03
04 import javax.swing.JApplet;
05
06 public class Load3DSApplet extends JApplet implements Runnable, Pathbuilder {
07
08 private static final long serialVersionUID = 1L;
09
10 private Load3DSGame game = null;
11
12 public void start() {
13 try {
14 game = new Load3DSGame(this, this);
15 game.finishOnESC(false);
16 getContentPane().add(game);
17
18 Thread gamethread = new Thread(this);
19 gamethread.start();
20 } catch (Exception e) {
21 System.err.println("Initialization failed");
22 e.printStackTrace();
23 }
24 }
25
26 public void run() {
27 game.play();
28 }
29
30 public InputStream createPath(String fileName) throws Exception {
31 System.out.println("createPath() filename=" + fileName);
32 URL url = new URL(getDocumentBase(), fileName);
33 InputStream in = url.openStream();
34 return in;
35 }
36
37 public void destroy() {
38 game.exit();
39 }
40
41 public void stop() {
42 game.exit();
43 }
44
45 }