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

2017/3/16

Scoreboard

Okiele1 Okiele1

2017/3/16

#
I have a game, that i want to make a scoreboard for, like a top ten in points. I know Greenfoot has one premade, but i can't seem to get it working. Is this very hard to do? And can i get around using the one Greenfoot made? Because i have to explain everything, as i am going to use this in an exam.. Thanks in advance!
danpost danpost

2017/3/16

#
Well, when you brought this up in the other discussion thread, I had a feeling you would need to create your own anyway. You will need to have knowledge both in the use of the UserInfo class (for accessing the data) and of the GreenfootImage class (for creating the scoreboard). Their API class documentations will be your go-to pages (your friends). Start by creating a subclass of Actor that will create a ScoreBoard object. Add to your existing game over code a check to see if UserInfo is available and, if so, create a ScoreBoard object. Test both cases of user logged in and not logged in (press Ctrl-Shift-P to change the user name; try with a name and with the field blank). If all goes well, then you can start on building the scoreboard. In its constructor, you will need to acquire the user data needed and then build the image that will be set to the scoreboard.
You need to login to post a reply.