@Override
	public void mouseClicked(MouseEvent arg0) {
		// TODO Auto-generated method stub

		int x=arg0.getX();
		int y=arg0.getY();
		
		if (0 <= x && x < 600 && 0 <= y && y < 600){
			cursorX = x/BLOCKSIZE;
			cursorY = y/BLOCKSIZE;
			setTile(cursorX, cursorY, currentTile);
		}
		
		if (tilesLft <= x && x < tilesRgt && tilesTop <= y && y < tilesBtm){
			currentTile = offset + ((y-tilesTop)/BLOCKSIZE)*4 + ((x-tilesLft)/BLOCKSIZE);
		}

		
	}