hey guys, not sure if this is the correct section so i apologise in advance, but im having some problems getting my game started.
I am using a tile map and at the moment all i want to display on the screen is the contents of my map text file, the code compiles fine, i run it and it switches to full screen and exits almost straight away. I then get a scary null pointer which looks a bit like this:
java.lang.NullPointerException
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:50)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:736)
at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:147)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2759)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2749)
at Game.draw(Game.java:28)
at GameCore.gameLoop(GameCore.java:72)
at GameCore.run(GameCore.java:29)
at Game.main(Game.java:10)
i believe it doesnt like something i have in a class ive called game so i will include that to see if thats where the problem lies:
[quote]import java.awt.*;
public class Game extends GameCore {
TileMap map;
public static void main(String[] args) {
Game a = new Game();
a.run();
}
public void init() {
super.init();
map = new TileMap(2, 2);
map.loadMap("map.txt");
}
public void draw (Graphics2D g) {
for (int y = 0; y <= map.getHeight(); y++){
for (int x = 0; x <= map.getWidth(); x++){
g.drawImage(map.getTileImage(x,y), x*40, y*40, null);
}
}
}
}
[/quote]
any help would be very appreciated 
(if any other information is needed let me know )
