public int[] getEnemyDanger(LevelEntity[][] level){
		int[] dangerArray = new int[level.length];
		Arrays.fill(dangerArray, Integer.MAX_VALUE);
		int distanceFromEnemy = level.length;
		for (int xx = 0; xx < level.length; xx++){
			for (int yy = 0; yy < level[0].length; yy++){
				if (level[xx][yy] == LevelEntity.Enemy || level[xx][yy] == LevelEntity.Cannon){
					distanceFromEnemy = 0;
					int reverseDistanceFromEnemy = 1;
					for (int nx = xx-1; nx >= 0; nx--){
						if (dangerArray[xx] > reverseDistanceFromEnemy){
							dangerArray[xx] = reverseDistanceFromEnemy;
						}
						else {
							break;
						}
						reverseDistanceFromEnemy++;
					}
					break;
				}
			}
			dangerArray[xx] = distanceFromEnemy;
			distanceFromEnemy++;
		}
		return dangerArray;
	}