public void actionPerformed(ActionEvent e) {

		if (inGame) {

			double curDelay = (double) (System.currentTimeMillis()-timerHelp);
			fps = (int) (1/((double)(curDelay/1000)));
			timerHelp = System.currentTimeMillis();
			
			checkCollision();
		}

		//checks to see if key is held down every game loop
		
		if (wPressed&&canMoveUp)
			movePlayer(0, -playerVelocity);
		if (aPressed&&canMoveLeft)
			movePlayer(-playerVelocity, 0);
		if (sPressed&&canMoveDown)
			movePlayer(0, playerVelocity);
		if (dPressed&&canMoveRight)
			movePlayer(playerVelocity, 0);

		repaint();
	}