[book PIC] Code for Killer Game Programming in Java

 

This page contains links to all the code used in the book.

You can download almost all the code as a single zip file, kgpjCode.zip (3.06 MB). kgpjCode.zip contains multiple zip files, one for each chapter of the book.

Alternatively, you can download the code on a chapter-by-chapter basis by going to the relevant chapter page via the top-level page of this site.

Files not in kgpjCode.zip

kgpjCode.zip doesn't actually contain all the code; it's missing four files which can be downloaded from here (or from the relevant chapter Web page):

 

Getting my Code to Work (Part 1)

I sometimes get queries about the code "not compiling" or "not working". It does compile and work, but you need to install Java and Java 3D first.

Java 3D is not part of the standard Java distribution; it's a separate download. Install Java first, then Java 3D.

  1. Java. Install the latest version of Java.
    The examples are known to work with all versions since J2SE 1.4.2.
     
  2. Java 3D is used extensively in this book -- it's the basis of all the 3D examples (15 chapters worth), two of the networking chapters, and its accurate timer class is used in six of the 2D chapters (chapters 2, 3, 4, 11, 12, and 13). There are alternatives to using the Java 3D timer, which I discuss in chapter 2.

    Install the latest version of Java 3D.
    The examples are known to work with all versions since Java 3D 1.3.1.
     
  3. Please test Java 3D before you try out my code.
    Download, compile, and execute HelloUniverse (2 KB). If Java 3D is properly installed, then it will show a spinning colored cube.
    HelloUniverse is a simplified version of a standard Java 3D example.
     

Getting my Code to Work (Part 2)

Each of the code directories contains its own readme.txt file which explains how to compile and execute that chapter's examples.

 

Getting my Code to Work with Linux

Jason Morin, a Linux games programmer, has had case-insensitivity problems when loading some files. For example, chapter 24 uses a 3D model which the code refers to as "Coolrobo.3ds". Unfortunately, the file is actually called "COOLROBO.3DS".

The case difference doesn't matter on Windows, which is why it slipped past me. On Linux, it triggers an error message about the file not being found.

The fix is to change the name of the file so its case matches that used in the code (e.g. rename "COOLROBO.3DS" to "Coolrobo.3ds"). There's no need to modify the Java code.


Navigation:


Dr. Andrew Davison
E-mail: ad@coe.psu.ac.th
Back to my home page