public GamePanel(GUI gui, long period, int w, int h) {
		this.gui = gui;
		this.period = period;
		pWidth = w;
		pHeight = h;

		setBackground(Color.white);
		//TODO Investigate this weird hack "pWidth-2"
		setPreferredSize(new Dimension(pWidth-2, pHeight));

		setFocusable(true);
		requestFocus(); // the JPanel now has focus, so receives key events
		readyForTermination();

		//TODO CREATE GAME COMPONENTS
		// create game components
		this.grid = Grid.getGridWithSpaceBetweenStripes(pWidth, pHeight, GUI.coordinateHeight, GUI.coordinateWidth);
		this.nodeList = new ArrayList<Node>();
		initialiseAllNodes();
		/** set up player 1 with deck and hand **/
		this.player1 = new Player(null, null, 100, Color.red, DropDirection.UP); //player
		player1.setBlockDeck(BlockDatabase.getRandomDeck(50, player1)); //deck
		player1.popBlock(5); //hand
		/** set up player 2 with deck and hand **/
		this.player2 = new Player(null, null, 100, Color.blue, DropDirection.DOWN); //player
		this.player2.setColor(Color.blue);
		player2.setBlockDeck(BlockDatabase.getRandomDeck(50, player2)); //deck
		player2.popBlock(5); //hand
		
		this.gui.setPlayerLeft(player2);
		this.gui.setPlayerRight(player1);
		setCurrentPlayer(player1);
		this.gamePhase = GamePhase.BlockPhase1;
		switchTurn();
		// END create game components END
		// FLAGS
		this.placeBlockFlag = false;
		// END FLAGS
		
		gameOver = false;

		//Handle click events
		addMouseListener(new MouseAdapter() {
			public void mousePressed(MouseEvent e) {
				if(SwingUtilities.isLeftMouseButton(e)){
					leftMouseButtonClicked(e.getX(), e.getY());
				}
				else if(SwingUtilities.isRightMouseButton(e)){
					rightMouseButtonClicked(e.getX(), e.getY());
				}
			}
		});
		
		//Handle mouse motion events
		addMouseMotionListener(new MouseAdapter() {
			
			private int lastX = -1;
			private int lastY = -1;
			
			public void mouseMoved(MouseEvent e) {
				int x = e.getX();
				int y = e.getY();
				if(y<880){
					int xCoordinate = x/GUI.coordinateWidth;
					int yCoordinate = y/GUI.coordinateHeight;
					if(xCoordinate!=lastX || yCoordinate!=lastY){
						mouseMotionEvent(xCoordinate, yCoordinate);
						lastX = xCoordinate;
						lastY = yCoordinate;
					}
				}
			}
		});

		// set up message font
		font = new Font("SansSerif", Font.BOLD, 14);
		metrics = this.getFontMetrics(font);

		// initialise timing elements
		fpsStore = new double[NUM_FPS];
		upsStore = new double[NUM_FPS];
		for (int i = 0; i < NUM_FPS; i++) {
			fpsStore[i] = 0.0;
			upsStore[i] = 0.0;
		}
	} // end of WormPanel()