title: How to use child attributes in a inherited method
body: <p>I'm making a basic game and want to create a "Character" parent class that will be a parent to both NPCs and the player character. What I'm struggling with is when I call an inherited method I want to be able to use a attribute  that is assigned in the child. To put it into context I want to write a draw function that I can call from the main program that passes the Graphics object to be draw to, I have a method here that worked while I was testing it by putting it directly into the player character class: </p>
  
  <pre><code>public void Draw(Graphics g)
          {
              g.DrawImage(image, coords[0], coords[1]);
          }
  </code></pre>
  
  <p>So I have this in the parent class but both the image and coords are assigned in the child class. I can define the type of variable the will be in the parent but it still doesnt recognise that the have been defined.</p>
  
  <p>I am calling it as <code>player.Draw(g)</code> (where player is an instance of the child class) but i either get "image is null" or "image is not defined" depending on whether I've put the <code>Bitmap image;</code> at the top or not. The image is definalty defined in the child class.</p>
  
  <p>TLDR: how do I get the parent class to reference something defined in a child class when calling the method from that child class.</p>