private synchronized void gameloop()
	{
		while(true)
		{
			frameBegin = System.nanoTime();		//Get current time in nanoseconds
			if (getGameState()== GameState.MAINMENU)
			{
				setGameState(GameState.PLAYING);
			}
			else if (getGameState()== GameState.PLAYING)
			{
				if(!keyList.isEmpty())
				{
					kp = keyList.lastElement();
					p1.move(kp);
				}
				for(int i=0; i<deadBombList.size();i++)//Won't execute if size=0
				{
					currBomb = deadBombList.get(i);
					bombExplosion(currBomb);
					deadBombList.remove(i);
					i--;
				}
				for(int i=0; i<explosionList.size();i++)//Won't execute if size=0
				{
					{
						gameGrid.removeFromGrid(explosionList.get(i));
						explosionList.remove(i);
						i--;
					}
				}
//				System.out.println(gameGrid.getGridCoordinates(p1));
//				System.out.printf("x: %d, y: %d\n", p1.getxPos(),p1.getyPos());
			}
			else if(getGameState()== GameState.PAUSED)
			{
				//Display "Paused", etc
				//TODO make all timers pause while paused
			}
			repaint();
		
			//Keep frames consistent
			frameEnd = System.nanoTime() - frameBegin;
			frameDelay = (10000000 - frameEnd) / 1000000;
//			System.out.printf("%d\n", frameDelay);
			
			if (frameDelay < 10)
			frameDelay = 10;

			try
			{
				Thread.sleep(frameDelay);
			} 
			catch (InterruptedException e) {}
		}
	}