public Board() {
        //0 for interactive
        //1 for queue
        // 2 forstack

        GenerateLevel allLevels = new GenerateLevel("map.txt");
        allLevels.checkStairs();
        this.levels = allLevels.getLevels();

        int start = 0;
        for (start = 0; start < 9; start++) {
            if (levels[start] != null) {
                if (levels[start].hasS) {
                    break;
                }
            }
        }
        levelNo = start;
        this.level = levels[start].getLevel();
        //frame.setSize(this.level.length*40+40, this.level.length*40+40);
        addKeyListener(new AL());
        p = new Player(this);
        p.setX(levels[start].getStaX());
        p.setY(levels[start].getStaY());
        setFocusable(true);

        ImageIcon sandA = new ImageIcon(("images\\sand.png"));
        ImageIcon greenA = new ImageIcon("images\\green.png");
        ImageIcon stoneA = new ImageIcon("images\\stone.png");
        ImageIcon Vict = new ImageIcon("images\\victim.png");
        ImageIcon bom = new ImageIcon("images\\bomb.png");
        ImageIcon doo = new ImageIcon("images\\gate.png");
        ImageIcon stai = new ImageIcon("images\\stairs.png");
        ImageIcon coin = new ImageIcon("images\\coinss.png");
        stone = stoneA.getImage();
        green = greenA.getImage();
        sand = sandA.getImage();
        victim = Vict.getImage();
        door = doo.getImage();
        bomb = bom.getImage();
        stairs = stai.getImage();
        coins=coin.getImage();
         ImageIcon up = new ImageIcon("images\\n.png");
     ImageIcon down = new ImageIcon("images\\s.png");

        ImageIcon left = new ImageIcon("images\\w.png");
        ImageIcon right = new ImageIcon("images\\e.png");
        ImageIcon upRight = new ImageIcon("images\\k.png");
        ImageIcon upLeft = new ImageIcon("images\\h.png");
        ImageIcon downRight = new ImageIcon("images\\l.png");
        ImageIcon downLeft = new ImageIcon("images\\j.png");
             ImageIcon ligh = new ImageIcon("images\\light2.png");
             light=ligh.getImage();
        n = up.getImage();
        s = down.getImage();
        e = right.getImage();
        w = left.getImage();
        nw = upLeft.getImage();
        sw = downLeft.getImage();
        k = upRight.getImage();
        l = downRight.getImage();


        time = new Timer(110, this);
        time.start();
        
    }