public WareHouseKeeper(Player player, Day current, BackToSchool frame){
    	backgroundSong = new Sound("sounds/Background/POL-misty-cave-short.wav");
    	backgroundSong.playSound();
    	student = player;
    	day = current;
    	this.frame = frame;
    	
    	earnedPercentage=0;
    	int delay = 1000; //milliseconds
    	ActionListener taskPerformer = new ActionListener() {
	        public void actionPerformed(ActionEvent evt) {
	        	
	        	timeRemains--;
	        	timerLabel.setText("Time: " + timeRemains);
	        	if(timeRemains == 0)
	        	{
	        		t.stop();
	        		isGameOver = true;
	        		earnedPercentage=0.1;
	        		resultLabel.setText("Time over :(");
	        		 experience.setText("Exp: "+earnedPercentage);
	        		exit.setVisible(true);
	            	resultLabel.setVisible(true);
	        	}
	        	controlPanel.repaint();
	            controlPanel.validate();
	            
	        }
    	};
    	t = new Timer(delay, taskPerformer);
    	
    	InputMap myInputMap = new InputMap();
		ActionMap myActionMap = new ActionMap();
    	
    	up up = new up();
		down down = new down();
		left left = new left();
		right right = new right();
		comma comma = new comma();
		myInputMap = this.getInputMap(WHEN_IN_FOCUSED_WINDOW);
		
		myInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0, false), "up");
		myInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_COMMA,0,false), "comma");
		myInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0, false), "down");
		myInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0, false), "left");
		myInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0, false), "right");
		
		myActionMap = this.getActionMap();
		
		myActionMap.put("up", up);
		myActionMap.put("down", down);
		myActionMap.put("left", left);
		myActionMap.put("right", right);
		myActionMap.put("comma", comma);
    	
    	setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        
        startScreen = new JLabel( new ImageIcon("art/warehouse/start.jpg") );
        
        
        welldone = new JLabel(  );
        welldone.addMouseListener( new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                welldone.setVisible(false);
                if(currentLevel < MAX_LEVELS )
                  initLevel(++currentLevel);
            }
        });
        
        levelLabel = new JLabel(  );
        levelLabel.setHorizontalTextPosition(JLabel.CENTER);
        levelLabel.setVerticalTextPosition(JLabel.CENTER);
        levelLabel.setFont(new Font("Comic Sans MS", Font.PLAIN, 12));
        levelLabel.setForeground(Color.black);
        
        timerLabel = new JLabel(  );
        timerLabel.setHorizontalTextPosition(JLabel.CENTER);
        timerLabel.setVerticalTextPosition(JLabel.CENTER);
        timerLabel.setFont(new Font("Comic Sans MS", Font.PLAIN, 12));
        timerLabel.setForeground(Color.black);
        
        resultLabel = new JLabel(  );
        resultLabel.setHorizontalTextPosition(JLabel.CENTER);
        resultLabel.setVerticalTextPosition(JLabel.CENTER);
        resultLabel.setFont(new Font("Comic Sans MS", Font.PLAIN, 12));
        resultLabel.setForeground(Color.black);
        
        restart = new JLabel(  );
        restart.addMouseListener( new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                 initLevel(currentLevel);
            }
        });
        restart.setVisible(false);
        
        undo = new JLabel ("Undo") ;
        undo.setFont(new Font("Comic Sans MS", Font.PLAIN, 12));
        undo.setForeground(Color.black);

        experience = new JLabel();
        
        countLabel = new JLabel(  );
        countLabel.setForeground(Color.black);
        countLabel.setFont(new Font("Comic Sans MS", Font.PLAIN, 12));
        countLabel.setHorizontalTextPosition(JLabel.CENTER);
        countLabel.setVerticalTextPosition(JLabel.CENTER);
        
        ground = new ImageIcon("art/warehouse/ground.jpg");
        wall = new ImageIcon("art/warehouse/wall.jpg");
        box =  new ImageIcon("art/warehouse/box.jpg");
        guy =  new ImageIcon("art/warehouse/guy.jpg");
        groundDot = new ImageIcon("art/warehouse/groundDot.jpg");
        boxDot = new ImageIcon("art/warehouse/boxDot.jpg");
        guyDot = new ImageIcon("art/warehouse/guyDot.jpg");
        
        p = new JPanel();
        
        exit = new JButton(new ImageIcon("art/buttons/exit_btn.jpg"));
        exit.setVisible(false);
    	exit.addActionListener(new exitButtonListener());
        
        controlPanel = new JPanel();
        controlPanel.setLayout(new BoxLayout(controlPanel, BoxLayout.Y_AXIS));
        
        bg = new Color(173,141,88);
        controlPanel.setBackground( bg);
        
        controlPanel.setPreferredSize( new Dimension (75,450));
        controlPanel.setMaximumSize( new Dimension (75,450));
        controlPanel.setMinimumSize( new Dimension (75,450));
        
        controlPanel.add(Box.createVerticalGlue() );
        controlPanel.add(levelLabel);
        //controlPanel.add(restart);
        controlPanel.add( Box.createRigidArea( new Dimension(5,25)) );
        //controlPanel.add(welldone);
        
        controlPanel.add(countLabel);
        controlPanel.add( Box.createRigidArea( new Dimension(5,25)) );
        controlPanel.add(undo);        
        controlPanel.add( Box.createRigidArea( new Dimension(5,25)) );
        controlPanel.add(timerLabel);
        controlPanel.add( Box.createRigidArea( new Dimension(5,25)) );
        controlPanel.add(resultLabel);
        controlPanel.add(Box.createVerticalGlue() );
        controlPanel.add(exit);
        controlPanel.add( Box.createRigidArea( new Dimension(5,25)) );
        controlPanel.add(experience);
        controlPanel.add( Box.createRigidArea( new Dimension(5,25)) );
        
        controlPanel.addMouseListener( new MouseAdapter() {
        	@Override
            public void mouseEntered(MouseEvent e) {
        		if(!isGameOver)
        		{
        			undo.setForeground( Color.orange); 
                    undo.setFont(new Font("Comic Sans MS", Font.BOLD, 12));
        		}
        		 controlPanel.setBackground( new Color(173,151,108) ); 
                 controlPanel.repaint();
 	             controlPanel.validate();
            }
            @Override
            public void mouseExited(MouseEvent e){
            	undo.setForeground( Color.black);
            	undo.setFont(new Font("Comic Sans MS", Font.PLAIN, 12));
            	controlPanel.setBackground( bg);
            	controlPanel.repaint();
	            controlPanel.validate();
            	
            }
            public void mousePressed(MouseEvent e){
            	if(!isGameOver)
            	{
            		if(!stack.isEmpty())
                    {
                        nums = stack.pop(); 
                        moveCount--;
                        reDraw();
                    }
                    
                    for( int i = 0; i < nums.length; i++ )
    	                for( int j = 0; j < nums[i].length; j++ )
    		                if(nums[i][j] == 3)
    		                {
    		                    spriteX = i;
    		                    spriteY = j;
    		                }
            		
            	}
            }
        });
        
        currentLevel = day.getDay();
        setBackground( new Color(199,188,136));      

        initLevel(currentLevel);
//        KeyListener listener = new MyKeyListener();    
//        addKeyListener(listener );
        setPreferredSize(new Dimension(550,450));
        
        add(Box.createHorizontalGlue() );
        add(p);
        add(Box.createHorizontalGlue() );
        add(controlPanel);
        setFocusable(true);
        
    
    
    }//End of the default constructor