Original Post
Hello.
I'm currently working a a 2D dungeon crawler game. I have a tile based system with a Tile class. This contains a whole heap of public static Tile. The problem is, when I try to access these from anywhere, I get a Null pointer Exception. I don't how i get this though since I quite clearly instatiate the variables. Heres the code
Please help, is there something I'm missing...
I'm currently working a a 2D dungeon crawler game. I have a tile based system with a Tile class. This contains a whole heap of public static Tile. The problem is, when I try to access these from anywhere, I get a Null pointer Exception. I don't how i get this though since I quite clearly instatiate the variables. Heres the code
public static Tile backgroundRock;
public static Tile bars;
public static Tile dirt;
public static Tile grass;
public static Tile grill;
public static Tile platform;
public static Tile rock;
public static Tile shaft;
public static Tile table;
public static Tile water;
static{
bars = new TileBars(0, 0, 0x404040);
dirt = new TileDirt(1, 1, 0x7F3300);
grass = new TileGrass(2, 2, 0x267F00);
grill = new TileGrill(3, 3, 0x3F2F2F);
rock = new TileRock(4, 4, 0x808080);
shaft = new TileShaft(5, 5, 0xFFD800);
table = new TileTable(6, 6, 0xFF4300);
water = new TileWater(7, 7, 0x0094FF);
platform = new TilePlatform(8, 8, 0x423300);
backgroundRock = new TileBackRock(9, 9, 0xFFFCF4);
}Please help, is there something I'm missing...