I want to have the same static variable with a different value depending on the type of class.
So I would have
public class Entity
{
public static Bitmap sprite;
public void draw(Canvas canvas, int x, int y)
{
canvas.drawBitmap(sprite, x, y, null);
}
}
public class Marine extends Entity
{
}
public class Genestealer extends Entity
{
}
And then in my main program go:
Marine.sprite = // Load sprite for all instances of Marine
Genestealer.sprite = // Load sprite for all instances of Genestealer
I don't want to store the same sprite in every instance of the class. I want one for each type of class. I want to inherit the static sprite variable and the draw function which will draw the sprite. But I don't want the Genstealer sprite to override the Marine sprite.
Is this possible?
How would I do it?