I'm making a 2D game in Java. I have a Sprite class and a Tile class. First I declared some static Sprite-objects in the Sprite-class
public class Sprite {
public static Sprite grass = new Sprite(0, 0, Spritesheet.testTiles);
...
And then I declared static Tile-objects in the Tile-class, and passed the static Sprite-objects as arguments, like this:
public class Tile {
public static Tile grass = new Tile("grass", Sprite.grass);
...
However for some reason the Sprite I'm passing is null. Any ideas why?
Whenever I'm using the grass-object anywhere else I have no problems.