@Override
	public void keyPressed(KeyEvent e) {
		if (e.getKeyCode() == KeyEvent.VK_LEFT) { 
			if (ship != null) 
			leftPressed = true; //sets the boolean to true.
			
		}
		else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
			if (ship != null) 
			rightPressed = true;	//set the boolean to true.
			
		}
		else if(e.getKeyCode() == KeyEvent.VK_UP)
		{
			if(ship!=null)
			{	
				//creates the audio for the ship.
				thrusterAudio();
				
				//sets the boolean to true.
				shipAccel = true;
			}
			
			
			
		}
		else if(e.getKeyCode() == KeyEvent.VK_SPACE)
		{
		
					if(ship!=null)
					{
						//as long as there less than eight
						//bullet objects on the screen,
						//another one is created when this is called.
						if(bulletTrack.size()<8)
					{
					//creates a new bullet object.
					bullet = new Bullet();
					
					//creates the audio for each bullet object.
					bulletAudio();
					
					//sets the position of each bullet object.
					bullet.setPosition(ship.getXNose(), ship.getYNose());
					
					//sets the rotation of each bullet object.
					bullet.rotate(ship.getRotation());
					
					//sets the velocity of each bullet object.
					bullet.setVelocity(BULLET_SPEED, ship.getRotation());
					
					//adds the bullet to the screen.
					screen.addParticipant(bullet);
					
					//adds the bullet object to the ArrayList.
					bulletTrack.add(bullet);
					
					//calls the removeBullet object.
					removeBullet(bullet);
					
					}
					}
		}
	
	}