public void paintComponent(Graphics g)
    { // Called when repaint is called on the ViewPanel when the model is //
      // updated
	if (LocalModel.getInstance().getScreenNumber() == 0 && LocalModel.getInstance().getFadeActive() == false)
	{ // ----------------SHINE GAME CREATION LOGO CODE-----------------
	  // LocalModel.getInstance().showData();
	    g.setColor(Color.white);
	    g.fillRect(0, 0, 700, 700);
	    
	    if (LocalModel.getInstance().getCount() < 28)
	    {
		Image logoframe = images.get("splash" + LocalModel.getInstance().getCount());
		// System.out.println(logoframe);
		g.drawImage(logoframe, -20, 100, this);
	    }
	    else
	    {
		Image logoframe = (Image) images.get("splash29");
		g.drawImage(logoframe, -20, 100, ViewPanel.getInstance());
		
	    }
	} //-----------------END SHINE LOGO CODE-----------------
	else if (LocalModel.getInstance().getScreenNumber() == 1)
	{ //--------------- TITLE SCREEN PAINTING-------------------
	    g.setColor(Color.black);
	    g.fillRect(0, 0, 700, 700);
	    g.drawImage(images.get("room"), 50, 25, this);
	    // room.paintRoom(g);
	    g.drawImage(images.get("title"), 0, 0, this);
	    if (LocalModel.getInstance().getControlsButton() == true)
	    {
		g.drawImage(images.get("controlsPressed"), 0, 0, this);
	    }
	    if (LocalModel.getInstance().getStartButton() == true)
	    {
		g.drawImage(images.get("startPressed"), 0, 0, this);
	    }
	}//------------ END TITLE SCREEN PAINTING----------------
	
	else if (LocalModel.getInstance().getScreenNumber() == 2)
	{
	    
	    if (LocalModel.getInstance().getStartGame() == false)
	    { // -----------------TRAINING ROOM----------------
		g.setColor(Color.black);
		g.fillRect(0, 0, 700, 700);
		g.drawImage(images.get("room"), 50, 25, this);
		// room.paintRoom(g);
		paintPlayers(g);
		g.drawImage(images.get("controls"), 0, 0, this);
		// System.out.println("ACE");
		//LocalModel.getInstance().showData();
	    } // -----------------END TRAINING ROOM ---------------
	    else
	    {//-------------------START GAME ROOMS-----------------
		// LocalModel.getInstance().showData();
		
		g.setColor(Color.black);
		g.fillRect(0, 0, 700, 700);
		g.drawImage(images.get("room"), 50, 25, this);
		// room.paintRoom(g);
		
		if (LocalModel.getInstance().getNewRoom() == true)
		{
		    fade(g);
		}
	    }
	    
	    if (LocalModel.getInstance().getChat() == null)
	    {//-----------------BEGINING CHAT-----------------
		// CHAT CREATES PLAYER
		// chat = new Chat();
		// addKeyListener(chat);
		// chatActive = true;
		
		if (LocalModel.getInstance().getChatActive() == true)
		{
		    // chat.paintChat(g);
		}
		else
		{
		    
		}
		
		if (LocalModel.getInstance().getFadeActive() == false)
		{
		    paintPlayers(g);
		}
		
		if (Model.getInstance().getEnemies().size() == 0)
		{
		    if (Model.getInstance().findUnitByID(0, "player").getY() > Model.getInstance().findUnitByID(0, "enemy").getY() || Model.getInstance().findUnitByID(0, "enemy").getKilled() == true)
		    {
			paintPlayers(g);
			if (Model.getInstance().findUnitByID(0, "enemy").getKilled() == true)
			{
			    LocalModel.getInstance().setCount(LocalModel.getInstance().getCount() + 1);
			    if (LocalModel.getInstance().getCount() > 20)
			    {
				Model.getInstance().addEnemy("Guard");
				LocalModel.getInstance().setCount(0);
				// enemy = new DungeonEnemy(1);
				// count = 0;
			    }
			}
		    }
		    else
		    {
			paintPlayers(g);
		    }
		}
		else
		{
		    paintPlayers(g);
		}
		
	    }
	}
	
	fade(g);
	
    }