public void init(LinesGame linesGame) {
		_linesGame = linesGame;
		_random = new Random();
		
		initSettings();
		
		_lineDirections = new ArrayList<Point>();
		_lineDirections.add(new Point(1, 0));
		_lineDirections.add(new Point(0, 1));
		_lineDirections.add(new Point(1, 1));
		_lineDirections.add(new Point(1, -1));
		_moveDirections = new ArrayList<Point>();
		_moveDirections.add(new Point(1, 0));
		_moveDirections.add(new Point(-1, 0));
		_moveDirections.add(new Point(0, 1));
		_moveDirections.add(new Point(0, -1));
		
		_state = new Ball[_nY][_nX];
		for (int i = 0; i < _nY; i++) {
			for (int j = 0; j < _nX; j++) {
				_state[i][j] = null;
			}
		}
		
		_queue = new Ball[_queueSize];
		for (int i = 0; i < _queueSize; i++) {
			_queue[i] = new Ball();
			_queue[i].init(getRandomType());
		}
		
		_selectedCellX = _selectedCellY = -1;
		_selectedBall = null;
		_freeCells = _nY * _nX;
	}