title: I made a rougelike game in visual studio and i want to display the players health
body: <p>I made a player class which holds everything related to the player. Can I call player.h in my GameSystem.h and do cout your health and go player._health. Am I doing something wrong cause it says class player type name is now aloud.</p>
  
  <pre><code>class Player
  {
  public:
  Player();
  void init(int level, int health, int attack, int defense, int experience);
  
  int attack();
  int takeDamage(int attack);
  
  
  
  // Set Player funtion
  void setPosition(int x, int y);
  
  void addExperience(int experience);
  
  void setHP(int hp);
  
  void setMaxHP(int hp);
  
  // Get player position
  void getPosition(int &amp;x, int &amp;y);
  
  
  private:
  // Player porperties
  int _level;
  int _health;
  int _maxHp;
  int _attack;
  int _defense;
  int _experience;
  
  // Player Position
  int _x;
  int _y;
  
  
  };
  </code></pre>
  
  <p>I want to call the players health in my GameSystem.cpp how would I go about doing that.</p>
  
  <pre><code>#include "GameSystem.h"
  #include "Player.h"
  #include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  
  
  // Constructor which sets up the game
  GameSystem::GameSystem(string levelFilename)
  {
  _player.init(1, 100, 10, 10, 0);
  
  _level.load(levelFilename, _player);
  
  system("pause");
  }
  
  void GameSystem::playGame() 
  {
  bool isDone = false;
  
  while (isDone != true)
  {
      _level.print();
      playerMove();
  }
  }
  
  void GameSystem::playerMove()
  {
  char input;
  printf(" Enter a move command (w/s/a/d: ");
  input = _getch();
  cout &lt;&lt; " Your Health:" &lt;&lt; Player._health;
  
  _level.movePlayer(input, _player);
  
  
  }
  </code></pre>