private void playGame()
	{	
		gameCurrentlyRunning = true;
		//infinite game!!
		while(true)
		{
			if(currentGame == totalLevels){
				JOptionPane.showMessageDialog( null, "Thanks for playing Asteroids! Congrats on battling the asteroid belt.\nRestart game..." );
				//gameCurrentlyRunning = false;
				currentGame = -1;
				break;
			}
			
			// Measure the current time in an effort to keep up a consistent
			// frame rate
			long time = System.currentTimeMillis();
			
			// If the ship has been dead for more than 3 seconds, revive it
			if(shipDead && shipTimeOfDeath + 3000 < time)
			{
				shipDead = false;
				ship = new Ship(playWidth/2, playHeight/2, 0, 0);
			}
			
			// Process game events, move all the objects floating around,
			// and update the display
			if(!shipDead)
				handleKeyEntries();
			handleCollisions();
			moveSpaceObjects();
			
			if(comets.isEmpty()){
				//still have more levels to play
				if(currentGame+1 != totalLevels);
				else{
					JOptionPane.showMessageDialog( null, "Thanks for playing Asteroids! Congrats on battling the asteroid belt.\nRestart game..." );
					//gameCurrentlyRunning = false;
					//break;
					currentGame = -1;
				}
				
				if(currentGame+1 >= maxLevelPlayed) maxLevelPlayed = currentGame+2;
				
				String label = "Level " + (currentGame+2) + " ready. Click okay to continue.";
				JOptionPane.showMessageDialog( null, label);
				currentGame++;
				nextLevel(currentGame);
			}
			
			// Sleep until it's time to draw the next frame 
			// (i.e. 32 ms after this frame started processing)
			try
			{
				long delay = Math.max(0, 32-(System.currentTimeMillis()-time));
				
				Thread.sleep(delay);
			}
			catch(InterruptedException e)
			{
			}
			
		}
	}