diff options
Diffstat (limited to 'src/RobotRace.java')
-rw-r--r-- | src/RobotRace.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/RobotRace.java b/src/RobotRace.java index 81a9355..40f0146 100644 --- a/src/RobotRace.java +++ b/src/RobotRace.java @@ -23,12 +23,12 @@ import java.util.Random; /** * Handles all of the RobotRace graphics functionality, * which should be extended per the assignment. - * + * * OpenGL functionality: * - Basic commands are called via the gl object; * - Utility commands are called via the glu and * glut objects; - * + * * GlobalState: * The gs object contains the GlobalState as described * in the assignment: @@ -44,7 +44,7 @@ import java.util.Random; * left and right with the 'a' and 'd' keys; * - Other settings are changed via the menus * at the top of the screen. - * + * * Textures: * Place your "track.jpg", "brick.jpg", "head.jpg", * and "torso.jpg" files in the same folder as this @@ -53,7 +53,7 @@ import java.util.Random; * Be aware, these objects are already defined and * cannot be used for other purposes. The texture * objects can be used as follows: - * + * * gl.glColor3f(1f, 1f, 1f); * track.bind(gl); * gl.glBegin(GL_QUADS); @@ -65,8 +65,8 @@ import java.util.Random; * gl.glVertex3d(1, 1, 0); * gl.glTexCoord2d(0, 1); * gl.glVertex3d(0, 1, 0); - * gl.glEnd(); - * + * gl.glEnd(); + * * Note that it is hard or impossible to texture * objects drawn with GLUT. Either define the * primitives of the object yourself (as seen @@ -237,14 +237,14 @@ public class RobotRace extends Base { gl.glEnable(GL_DEPTH_TEST); gl.glDepthFunc(GL_LESS); - // Enable textures. + // Enable textures. gl.glEnable(GL_TEXTURE_2D); gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); gl.glBindTexture(GL_TEXTURE_2D, 0); // initialize lighting effects (lighting bit is not enabled here though) initLighting(); - + // init terrain terrain.createTerrain(); } @@ -580,27 +580,27 @@ public class RobotRace extends Base { // reset color gl.glColor3f(0, 0, 0); } - + public Texture getTorsoTexture() { assert torso != null; return torso; } - + public Texture getHeadTexture() { assert head != null; return head; } - + public Texture getBrickTexture() { assert brick != null; return brick; } - + public Texture getTrackTexture() { assert track != null; return track; } - + /** * Main program execution body, delegates to an instance of the RobotRace * implementation. @@ -691,7 +691,7 @@ public class RobotRace extends Base { }; int i = Arrays.asList(trackNumbers).indexOf(e.getKeyCode()); assert i != -1 : "Track number not found for key"; - System.err.println("Changing to track number " + i); + System.err.println("Changing to track number " + i); robotRace.gs.trackNr = i; robotRace.mainWindow.updateElements(); } @@ -716,7 +716,7 @@ public class RobotRace extends Base { } return enableTextures; } - + /** * If pause toggle is requested, check state and update. Otherwise, adjust * global animation time. |