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

2020/6/19

plz help me danpost

1
2
Roshan123 Roshan123

2020/6/19

#
i made a scenario and their is a scoreboard at the end of the game which saves the user's name and score plz try to understand with the example When i play (it is saved as player1 scores 30), when somebody else plays (it shows the same i.e. player1 scores 33) i want it to save the score separately for me and the other person and also want to change the name i.e. player1(roshan) and for the other person(xyz) how will i do that. plz write the steps for it
danpost danpost

2020/6/19

#
When game over, use Greenfoot.ask to get name.
Roshan123 Roshan123

2020/6/19

#
do you mean this
if(health==0)
{ 
     Greenfoot.ask();
}
Roshan123 Roshan123

2020/6/19

#
but how will this work
Roshan123 Roshan123

2020/6/19

#
will it only ask the user's name or something else i have to write
danpost danpost

2020/6/19

#
Roshan123 wrote...
but how will this work
String name = Greenfoot.ask("Enter your name");
You can ask for any input, which is then placed into the variable (here, "name").
Roshan123 Roshan123

2020/6/20

#
but when it asks i save my name roshan and it shows me roshan scores 40 and when i again play and save it as xyz it doesnot make any other player and saves xyz scores 43 inplace of my name
danpost danpost

2020/6/20

#
Roshan123 wrote...
but when it asks i save my name roshan and it shows me roshan scores 40 and when i again play and save it as xyz it doesnot make any other player and saves xyz scores 43 inplace of my name
Are you using the UserInfo class?
Roshan123 Roshan123

2020/6/20

#
yes i used userinfo
Roshan123 Roshan123

2020/6/20

#
i made this with the help of miachel kolling trick the turtle with highscore(scoreboard)
danpost danpost

2020/6/20

#
Roshan123 wrote...
yes i used userinfo
Oh, okay. Then forget my suggestion above. You can "logiin" by going to the Miscellaneous tab of the Preferences window and edit the user name. I think Ctrl-Shift-P will bring the field to edit up directly.
Roshan123 Roshan123

2020/6/21

#
from where did you learned the keys for saving userinfo data is their any website for it. if their is any website then plz share the link for it. i want to know about the other keys ; for example now i want to delete one of the user name . so what is the key for it
danpost danpost

2020/6/21

#
Roshan123 wrote...
from where did you learned the keys for saving userinfo data is their any website for it. if their is any website then plz share the link for it. i want to know about the other keys ; for example now i want to delete one of the user name . so what is the key for it
You will find a "storage.csv" file in your scenario folder. Edit it (remove unwanted row of data) or just delete the file (to clear all data and start over)..
Roshan123 Roshan123

2020/6/21

#
and is their any way to save photo in greefoot because when i upload in on website it shows my profile picture but i want to show my picture in greenfoot applicantion
Roshan123 Roshan123

2020/6/21

#
is it possible
There are more replies on the next page.
1
2