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

2017/3/17

how to create a scoreboard

1
2
danpost danpost

2017/3/17

#
rachpaguia@gmail.com wrote...
WIll line 3 look like this?
1
public A(); private int killCount = 0;
No. If you insert the line, it will look more like this:
1
2
3
private int killCount = 0;
 
public A()
Thank you,, one last question for this topic, how do we use the show text code for it to appear in a part of my background?
the score to appear i mean
danpost danpost

2017/3/17

#
rachpaguia@gmail.com wrote...
how do we use the show text code for it to appear in a part of my background?
In the act method, between lines 17 and 18 (see code near bottom of first page in this discussion), insert the following line:
1
getWorld().showText("Kills: "+killCount, 100, 15); // change location as needed
Thank you so much ! god bless
You need to login to post a reply.
1
2