Alright guys, so I’ve got a GameObject class and I inherited it to my Player class.
So I’ve done this in the constructor:
public Player(Vector2 position, Texture2D tex):base(position,tex)
{
}
Now, I have a Draw method, and I need the Texture to use the Draw method.
But because I used the Texture from the GameObject class I can’t use the texture in this method.
What can I do about it?
Leave a comment if you didn’t understand anything.
Thanks in advance.
You should post a snippet of your GameObject class. Using my psychic abilities, I reckon your Texture object is declared as private in GameObject. Change it to protected like this:
Read Access Modifiers to learn more about using private, protected, etc.