@SuppressWarnings("deprecation")
	public void run(){
		
		System.out.println("HEALTHY 2: " + model.character.health);
		
		/*
		 * Create a new display, which all of the GL11 commands will be applied to.
		 */
		try {
			Display.create();
		} catch (Exception e2) {
			e2.printStackTrace();
			System.exit(0);
		}
		
		GL11.glViewport(0, 0, WIDTH, HEIGHT);
		
		GL11.glEnable(GL11.GL_DEPTH_TEST);
		GL11.glDepthFunc(GL11.GL_LEQUAL);
		GL11.glShadeModel(GL11.GL_SMOOTH); // Enables Smooth Shading
		/*
		 * Enable masking transparency.
		 */
		GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);	
		GL11.glEnable(GL11.GL_BLEND);
		GL11.glAlphaFunc(GL11.GL_GREATER,0.1f);
		GL11.glEnable(GL11.GL_ALPHA_TEST);
		GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
		GL11.glClearColor(0f, 0f, 0f, 1f);
		
		while (!Display.isCloseRequested()) {
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			/*
			 * All OpenGL Display code goes here!
			 */
//			focalPoint = model.characterPosition;
			if (!splashMode) { 
				if (Model.rumble > 2){
					viewTranslation = new Vector3D(viewTranslation.getX(), viewTranslation.getY(), INITDISTANCE + new Random().nextInt(Model.rumble / 2) - Model.rumble / 4);
					Model.rumble--;
				} else {
					Model.rumble = 0;
				}
			}
			
			if (model.character.health <= 0 && !splashMode) {
				System.out.println("CREDITS");
				new Credits(this).start();
			}
			
			setCamera(); // *DO NOT CHANGE THIS*
			float viewScale = 1;
			Rectangle viewRect = new Rectangle((int) (viewTranslation.getX() - WIDTH * viewScale / 2), (int) (viewTranslation.getY() - HEIGHT * viewScale / 2),
												(int) (WIDTH * viewScale), (int) (HEIGHT * viewScale));
			
			// TODO figure out what's wrong with viewRect and fix it
			/*
			 * Stuck some padding in there for good measure -- draws only sprites that fall within 100 of the viewRect
			 */
			for (Sprite sprite : model.rtree.getSpritesInRectangle((int) viewRect.getX() - 1, (int) viewRect.getY() - 1,
																	(int) viewRect.getWidth() + 2, (int) viewRect.getHeight() + 2)){
					sprite.draw();
			}
//			model.rtree.draw(400);
			
			/* Lighting */
			for (Light light : model.lights) {
				glMaterial(GL_FRONT, GL_SPECULAR, light.matSpecular);				// sets specular material color
				glMaterialf(GL_FRONT, GL_SHININESS, 50.0f);					// sets shininess

				glLight(GL_LIGHT0, GL_POSITION, light.lightPosition);				// sets light position
				glLight(GL_LIGHT0, GL_SPECULAR, light.whiteLight);				// sets specular light to white
				glLight(GL_LIGHT0, GL_DIFFUSE, light.whiteLight);					// sets diffuse light to white
				glLightModel(GL_LIGHT_MODEL_AMBIENT, light.lModelAmbient);		// global ambient light 
			}
			
			glEnable(GL_LIGHTING);										// enables lighting
			glEnable(GL_LIGHT0);										// enables light0
			
			glEnable(GL_COLOR_MATERIAL);								// enables opengl to use glColor3f to define material color
			glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);			// tell opengl glColor3f effects the ambient and diffuse properties of material			
			Display.update();
		}
		Display.destroy();
		AL.destroy();
		System.exit(0);
	}