Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Should i inherit my classes from Sprite class?

$
0
0

@danialabdl wrote:

Hi.
I 'm trying to make a Matermind game(I think all of you are familiar with it) using MG.extended.
For start i have two class : "Piece" and "Hole" (i want drag pieces to holes with mouse )and i want them to be inherited from Sprite class with one different: texture should be load without passing to constructor as an argument. But when i try to make 0 argument constructor for "Hole" or "Piece" i get this error ("Sprite doesn't have a constructor with zero argument").
-So how can i load texture for my inherited class (from Sprite) without passing it to constructor?
Can i make a zero argument constructor for my class?
Or maybe i should inherit from another class?

I hope it is clear.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles