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

2012/1/31

ok so im almost there....

programmer22 programmer22

2012/1/31

#
been trying to get my scoreboard to get the score from the counter and this is what i was left with but im unsure where to put the last part 01.CrabWorld w = (CrabWorld) getWorld(); 02.Counter c = w.counter; 03.//Then to get the score variable, you just use "c.getValue()" <--- where do i put that ? like counter score board? and how would i start the method if it was a new one and would i put all of that in the text part of a method or in the colored part?
danpost danpost

2012/1/31

#
Put it in the act() method of your scoreboard. If your scoreboard has an instance variable for the score named 'score', use 'score = c.getValue();'. When creating the scoreboard just initialize the score to zero.
You need to login to post a reply.