private void randomMove(int number){
        Random random = new Random();
        double dx = random.nextDouble()*pow(-1, random.nextInt())/20;
        double dy = random.nextDouble()*pow(-1, random.nextInt())/20;
        if (canNotPassWall(beings.get(number).getX(), dx, beings.get(number).getY(), dy)){
            dx*=-1;
            dy*=-1;
        }

        if (beings.get(number).getY() > Y_AREA && !canEscape){        //todo doesn't work
            dy = (Y_AREA - beings.get(number).getY());
        }
        if (beings.get(number).getY() < 0 && !canEscape){
            dy = -1* beings.get(number).getY();
        }
        if (beings.get(number).getX() > X_AREA && !canEscape){
            dx =  (X_AREA - beings.get(number).getX());
        }
        if (beings.get(number).getX() < 0 && !canEscape){
            dx = -1 * beings.get(number).getX();
        }

        beings.get(number).move(dx, dy);
    }