This site requires JavaScript, please enable it in your browser!
Greenfoot back
Javanovice
Javanovice wrote ...

2015/12/2

I am trying to add a scoreboard to my gamer, but it gives me an compiling error saying cannot find variable - variable scoreboard

Javanovice Javanovice

2015/12/2

#
private void prepare()
    {
       scoreboard = new ScoreBoard();
       addObject(scoreboard, 103, 51);
    }
danpost danpost

2015/12/2

#
The 'scoreboard' variable is not declared anywhere. Either place the following line in the code:
ScoreBoard scoreboard = null;
or change line 3 to the following:
ScoreBoard scoreboard = new ScoreBoard();
Javanovice Javanovice

2015/12/3

#
Thanks Dan, it worked!
You need to login to post a reply.