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

2012/4/14

Can somebody explain me how I can make a hiscore

1
2
3
4
martijn13039 martijn13039

2012/4/14

#
I really need help and I have no idea how I can do it, so I hope somebody can explain and let me understand
SPower SPower

2012/4/14

#
If you already have experience with Java and Greenfoot, you can download a course I wrote: http://www.2shared.com/document/fK0wPwlQ/Learning_Greenfoot_22.html I wrote this course for people who want to upgrade their skills to Greenfoot 2.2, and that includes using the new Highscore APIs (class PlayerData) in Greenfoot 2.2. I love to hear what you think about it (if you're going to use it)
martijn13039 martijn13039

2012/4/14

#
I think I wil use it but I think it wil be hard because I´m not a very good programmer like u
-nic- -nic-

2012/4/14

#
im a nubie and i managed it so you can:):D
martijn13039 martijn13039

2012/4/14

#
first I wil say I think that I´m the nubie because I have a lot of problems to make it I hope you can giff me some more advice
-nic- -nic-

2012/4/14

#
first of all go to the page that spower said and follow his course (add all of the class you need, copy and paste works well)when you do that if it doesent work post your code and ill have a look ok?? :)
martijn13039 martijn13039

2012/4/14

#
oke thx
martijn13039 martijn13039

2012/4/14

#
look this is the code I have but er is a bug or something like that. because there stay can not find playerdata class I hope you can help me nic import greenfoot.*; public class Saver { private PlayerData player; public Saver() { if (concierge.isStorageAvailable() ) { if (concierge.getMyData() != null) { concierge = PlayerData.getMyData(); } } } public void saveHighscore(int score) { if (concierge.isStorageAvailable() ) { if (concierge !=null) { if (score > concierge.getScore() ) { concierge.setScore(score); concierge.store(); } } } } }
-nic- -nic-

2012/4/14

#
private PlayerData player; here you put player but lower you put concierge?? also if (concierge.getMyData() != null) { i put if (PlayerData.getMyData() != null) {?? see also futher down you put if (concierge.isStorageAvailable() ) { i put if (PlayerData.isStorageAvailable() ) { hope this helps:)
martijn13039 martijn13039

2012/4/14

#
hey nic I follow your tip but er is still something wrong because if I pus on compile er is a bug namely cannont find symbol- PlayerData this is the new code I hope you can gif me an other tip import greenfoot.*; public class Saver { private PlayerData player; public Saver() { if (concierge.isStorageAvailable() ) { if (PlayerData.getMyData() != null) { concierge = PlayerData.getMyData(); } } } public void saveHighscore(int score) { if (PlayerData.isStorageAvailable() ) { if (concierge !=null) { if (score > concierge.getScore() ) { concierge.setScore(score); concierge.store(); } } } } }
-nic- -nic-

2012/4/14

#
what bit does it highlight??
SPower SPower

2012/4/14

#
ABSOLUTELY don't say: congierge.isStorageAvailable() !!!!!!!!!!!!!!!!!!! Only the PlayerData class has the isStorageAvailable() method, why would congierge can save your highscore?????!!!!!!! This wasn't really smart of you......
-nic- -nic-

2012/4/14

#
you talking to me?
martijn13039 martijn13039

2012/4/14

#
I´m sorry for upsetting but I´m not the best progammer on the world but I changes the code but it stil not working if I compile it er stay again cannont find symbol- PlayerData I hope both of you can help me with import greenfoot.*; public class Saver { private PlayerData player; public Saver() { if (PlayerData.isStorageAvailable() ) { if (PlayerData.getMyData() != null) { PlayerData = PlayerData.getMyData(); } } } public void saveHighscore(int score) { if (PlayerData.isStorageAvailable() ) { if (PlayerData !=null) { if (score > PlayerData.getScore() ) { PlayerData.setScore(score); PlayerData.store(); } } } } }
danpost danpost

2012/4/14

#
Instead of
PlayerData = PlayerData.getMyData();
try
player = PlayerData.getMyData();
There are more replies on the next page.
1
2
3
4