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

2012/2/3

How to add scores?

craigv craigv

2012/2/3

#
In the world have a counter and a value that increases for every object hit.
DonaldDuck DonaldDuck

2012/2/6

#
Make an int in the World class called score a method in the object that says (() getWorld()).score+=; Now make a class that draws a string in the act method, something along the lines of getImage().clear(); getImage().drawString("Score: "+(() getWorld()).score, 100, 50); If you can't see the score printed on the images, ensure you have set the image of it to an image at least 200x100 (setImage(new GreenfootImage(200, 100));)
You need to login to post a reply.