public boolean monsterAttack(int userPosition, int player) {
        boolean dead = false;
        for (int i = 0; i < numberofEnemys; i++) {
            if (dead == false) {
                if (enemyLocation.get(i) != null) {
                    int enemyLoc = enemyLocation.get(i);
                    int enemyLocXY[] = getTileLocation(enemyLoc);
                    int userLocXY[] = getTileLocation(userPosition);

                    int distance = calculateDistance(enemyLocXY, userLocXY);
                    if (distance <= 6) {

                        int attackBonus;
                        if (isAdjacent(userPosition, enemyLoc)) {
                            attackBonus = calculateAttackBonus(i, "enemy", "melle");
                        } else {
                            attackBonus = calculateAttackBonus(i, "enemy", "ranged");
                        }
                        int armorClass = calculateArmorClass(player, "user");

                        int callRoll = cal1d20Roll();
                        fightingInformation.append("\n Enemy's is Attack bonus  is : " + attackBonus + " \n Roll 1d20 Dice :" + callRoll + "\n" + " Players' Armour class (AC) is :" + armorClass + "\n");
                        System.out.println("User is under attack Attack bonus  of" + i + " :: " + attackBonus + " Armour class" + armorClass);
                        if ((callRoll + attackBonus) > armorClass) {
                            // Decrease the health

                            fightingInformation.append("Player is under Attack" + "\n");
                            fightingInformation.append("Damage Point =(Rolling 1d8 Dice + attackBonus ) = ");
                            int damagePoint = cal1d8Roll() + attackBonus;
                            fightingInformation.append("" + damagePoint);
                            users.get(player).setHealth(users.get(player).getHealth() - (damagePoint));
                            System.out.println("User" + player + "'s health is " + users.get(player).getHealth());
                            fightingInformation.append("\n Players hit Point" + users.get(player).getHealth() + "\n");
                        }
                        if (users.get(player).getHealth() < 0) {
                            // The player is dead
                            dead = true;
                        }
                        if (dead == true) {
                            System.out.println("The user : " + player + " is dead");

                            fightingInformation.append("Player " + player + "is dead now ! \n");
                            System.out.println("Pos of user" + userPosition);
                            tile[userLocation.get(currentplayer) - 1].setIcon(null);
                            users.remove((Object) player);
                            userLocation.remove((Object) player);
                            turnPanel.inventory[player].setVisible(false);

                            System.out.println("Monster Attacking kill" + userLocation);
                            if (users.size() == 0) {
                                System.out.println("Game is over my friend");
                                JOptionPane.showMessageDialog(null, "Game is over !");
                                fightingInformation.append("Game Over !");
                            }
                        }
                    }
                }
            }
        }

        return dead;
    }