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

2012/5/10

Help?

Serhil Serhil

2012/5/10

#
I've got a ScoreImage in my game, but when I place this code in my world: public void UpdateScore(int newScore) { scoreCounter.add(newScore); } I get a error: Cannot find symbol - method add(int) can somebody help me please?
davmac davmac

2012/5/10

#
What type is 'scoreCounter'? (how is it declared?) The error is telling you that there is no 'add' method in the class that scoreCounter is declared as.
Serhil Serhil

2012/5/10

#
I copied it from a game, but this is what i've got in my world: public class Angrybirdsworld extends World { private ScoreImage scoreCounter; public Angrybirdswold() { scoreCounter = new ScoreImage("Score: "); addObject(scoreCounter, 60, 30); }
SPower SPower

2012/5/10

#
You didn't copy the add(int) method ....
davmac davmac

2012/5/10

#
It does seem like your 'ScoreImage' class doesn't have an 'add(int)' method; yet you're trying to call that method.
SPower SPower

2012/5/10

#
@davmac That's what I tried to say :)
You need to login to post a reply.