[Solved] Exception in Thread “AWT-EventQueue-0” Tower Defense [closed]


In the Room class, the block variable (or one of its elements) is null. Because the error happens on this line:

    public void draw(Graphics g)
    {
>       for(int y=0;y<block.length;y++) 
        {
            for(int x=0;x<block[0].length;x++)
            {
                block[y][x].draw(g);
            }
        }
    }   

I’d say you haven’t called define() (which seems to initialize the block variable) on your room by the time the draw() method has been called.

1

solved Exception in Thread “AWT-EventQueue-0” Tower Defense [closed]