src/main/java/tsz/game/controller/GameController.java
/**
	 * Check whether the player's car is crashed with an obstacle car.
	 * @param player - the player's car.
	 */
Check whether the player's car is crashed with an obstacle car.
@param player - the player's car.
Check whether the player ' s car is crashed with an obstacle car . @param player - the player ' s car .
private void isCrashed(PlayersCar player) {
		for(Car i : gameWindow.getOCars()) {
			if( Math.abs(i.getX()-player.getX()) < 68 &&
				Math.abs(i.getY()-player.getY()) < 102)
				if(Math.sqrt(Math.pow(i.getX()-player.getX(),2)+Math.pow(i.getY()-player.getY(), 2)) < 100) {
					logger.info("Cars crashed.");
					endTheGame();
				}
			}
	}
private void isCrashed ( PlayersCar player ) { for ( Car i : gameWindow . getOCars ( ) ) { if ( Math . abs ( i . getX ( ) - player . getX ( ) ) < 68 && Math . abs ( i . getY ( ) - player . getY ( ) ) < 102 ) if ( Math . sqrt ( Math . pow ( i . getX ( ) - player . getX ( ) , 2 ) + Math . pow ( i . getY ( ) - player . getY ( ) , 2 ) ) < 100 ) { logger . info ( "Cars crashed." ) ; endTheGame ( ) ; } } }
Check whether the player's car is crashed with an obstacle car.
Check whether the player ' s car is crashed with an obstacle car .