title: C++ | Drawing Different Enemies With Same Class? with inheritence
body: <p>I m a little bit confused about inheritence. I created an enemy class and calling enemies with a vector like this:</p>
  <pre><code>class enemy
  {
  public:
      sf::RectangleShape rect;
      float bottom, left, right, top;
      sf::Texture enemytexture;
      sf::Sprite enemysprite;
  
      enemy(sf::Vector2f position, sf::Vector2f size, sf::Color color)
      {
          rect.setPosition(position);
          rect.setSize(size);
          rect.setFillColor(color);
          enemytexture.loadFromFile(&quot;npc1.png&quot;);
          enemysprite.setTexture(enemytexture);
      }
  
      void update(){
          //////}
      };
  
      class goblin : public enemy
      {
      public:
          goblin(sf::Vector2f position, sf::Vector2f size, sf::Color color);
          void update()
          {
              enemytexture.loadFromFile(&quot;npc2.png&quot;);
              enemysprite.setTexture(enemytexture);
          };
      };
  
      std::vector&lt;std::unique_ptr&lt;enemy&gt;&gt; enemies1;
  
      enemies1.emplace_back(std::unique_ptr&lt;enemy&gt;(
          new enemy(sf::Vector2f(100, 100), sf::Vector2f(15, 10), sf::Color(255, 255, 255, 255))));
  
      enemies1.emplace_back(std::unique_ptr&lt;enemy&gt;(new goblin::enemy(
          sf::Vector2f(100, 100), sf::Vector2f(15, 10), sf::Color(255, 255, 255, 255))));
  </code></pre>
  <p>But i would like to draw different enemies and sprites like goblin etc. With this sample i draw only npc1.png for enemy and goblin classes. Is it possible to do that or do i need create another class? I searched some tutorials about inheritence but i cannot solve my problem. Plz i will appreciate for every suggestion or help.</p>