public void paintComponent(Graphics g){
         m.paintBackground(g);
         m.paintObstacles(g);
      	
         /*g.setColor(Color.red);
         g.fillRect(player.getX(), player.getY(), player.length, player.height);
         g.setColor(Color.blue);
         g.drawRect(player.getX(), player.getY(), player.length, player.height);//created in player*/
         
         player.paintSprite(g, player.getSprite());
         
      	
         g.setColor(Color.red);//checking conditions
         g.drawString("I: " + m.getY() + " A: " + m.getX(), 25, 25);
         g.setColor(Color.white);
         g.drawString("X: " + player.getX() + "  Y: " + player.getY(), 50, 410);
         g.setColor(Color.white);
         g.drawString("X: " + player.getX() + "  Y: " + player.getY(), 50, 410);
         if(!player.rChange)
         { g.drawString("right collided!", 200, 410);}
         if(!player.lChange)
         { g.drawString("left collided!", 200, 410);}
         if(!player.uChange)
         { g.drawString("up collided!", 200, 410);}
         if(!player.dChange)
         { g.drawString("down collided!", 200, 410);}
         if(player.getDoor())
            g.drawString("door", 300, 410);
         if(player.getDoor()==false)
            g.drawString(""+door.toString(), 300, 410);
      }