@Override
	public void update(){
		//invalid moves are reversed, so an invalid position at this point is an extreme condition
		if(!isPositionValid())
			escape();
		double dx = velocity.x * speed;
		double dy = velocity.y * speed;
		projectedCenter.setLocation(center.x + dx, center.y + dy);
		//check other ball collisions
		boolean aloneFlag = true;
		for(Ball other : Game.gameField.getBalls()){
			if(other == this)
				continue;
			checkCollision(other);
			if(quadrant.equals(other.getQuadrant())){
				aloneFlag = false;
			}
		}
		isAlone = aloneFlag;
		//check wall collisions
		for(Wall wall : Game.gameField.getWalls()){
			wall.checkCollision(this, projectedCenter);
		}
		//check boundary collisions
		Game.gameField.checkBoundaryCollision(this, projectedCenter);
		//collisions may have changed the velocity vector
		dx = velocity.x * speed;
		dy = velocity.y * speed;
		move(dx, dy);
		//check if the move is valid, if not move back
		if(!isPositionValid()){
			move(-dx, -dy);
		}
		quadrant = Calculations.getQuadrant(center, Game.gameField.getWalls());
	}