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

2012/2/21

support class - counter

craigv craigv

2012/2/21

#
how can I use this support class to keep score? I have an asteroid type game, where my gunner shoots a ball, and makes contact with other objects ( thats when i want a score to be added) thanks
davmac davmac

2012/2/23

#
First have a look at the methods available in the Counter class. It should be fairly obvious which methods you need to call to change the score. Then, when your program detects an event which should cause an increase in the score, call the appropriate Counter method. Have a look at this tutorial for general help with calling the counter methods from some other class. The tutorial doesn't use the Counter support class, but the principles are the same.
You need to login to post a reply.