Appendix 3: Creating Applet for online distribution

To make your Env3D an Applet so that it can be viewed from a web browser. Follow these simple steps:

  1. Make sure that your game loop is inside the class called "Game".
  2. Make sure that your game loop is inside the method "play().
  3. Add the following import statement:
    import env3d.EnvApplet;
    
  4. Change your Game class decoration to look like the following:
    public class Game extends EnvApplet
    
  5. Compile your program, make sure that there no errors.
  6. Right click on the "Game" class and select the "Run Env3D Applet" option at the bottom of the pop-up menu.
  7. After waiting for a bit, your browser would launch. Accepted all the security warnings, your program would start running inside the browser.
  8. (optional) To make your program available on the WWW, upload the "applet/" directory inside your BlueJ project to a public web server. The html file to launch your application is appletloader.html.

NOTE: You can also right-click on the Game class and select the "Upload to Env3D.org" option to upload your applet directly to Env3D.org.  You can then share your game link with others.