The entrypoints for understanding the Tetris code are TetrisApplet.class and TetrisFrame.class. The Applet class is used when Tetris is embedded into a website. The Frame class is used for standalone use.
Use as an applet
If you want to use the tetris game on your website just take a look at the play page source and look for the applet tag.
As you can see two files are referenced tetris.jar and jdom.jar. Load these files from my website and save them in the same directory as your html page that contains the applet.
Use as an application
Load the jar files to your computer.
Then call java -jar jdom.jar -jar tetris.jar
The tetris.jar file contains a manifest to tell java which class should be used to start the application. I will try to make this easier by integrating the jdom.jar into tetris.jar in the future. Then the tetris.jar can simply be double clicked in windows.
The jdom library is used to load and save the highscores in an xml file.
Developer Documentation
Browse the Javadoc
Add Comment