private void gameLoop()
	{

		long beginTime, timeTaken, timeLeft;
		while (true)
		{
			beginTime = System.nanoTime();
			
			if (_state == GameState.INITIALIZED || _state == GameState.GAMEOVER)
			{
				//do menu screen
				
			}
			else if (_state == GameState.PLAYING)
			{
				if(_alienController.getAliensRemaining() == 0)
				{
					// transition to next state
					_backgroundScrollDown = false;
					setGameState(GameState.SCROLL_UP_BETWEEN_LEVELS);
				}
				
				if (getShoot())
				{
					shoot();
					setShoot(false);
				}

				_tracker.update();
				dropAlienBombsIfReady();
				moveAssets();
				detectCollisions();
				updateScore();
			}
			else if (_state == GameState.READY_FOR_NEXT_LEVEL)
			{
				_level += 1;
				_alienController.setupLevel(_level);
				// transition to next state
				_backgroundScrollDown = true;
				setGameState(GameState.PLAYING);
			}
			
			repaint();
			// _canvas.repaint();

			timeTaken = System.nanoTime() - beginTime;
			timeLeft = (UPDATE_PERIOD - timeTaken) / 1000000;
			
			if (timeLeft < 10)
				timeLeft = 10;

			try
			{
				Thread.sleep(timeLeft);
			} catch (InterruptedException ex)
			{
			}
		}
	}