This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
DustTerminator
wrote ...
2017/5/16
Highscore
DustTerminator
2017/5/16
#
Hello! I have a problem with a game. How do I make a highscore variable that will keep the values of the greatest score even if i press restart?
danpost
2017/5/16
#
You can use a 'static' field to hold the best score during each session (from compile to compiler, or loading to loading).. Resetting does not re-initialize static fields.
DustTerminator
2017/5/16
#
Can you give me an exmaple please. Shoul i use the public static int form? or how?
danpost
2017/5/16
#
DustTerminator wrote...
Shoul i use the public static int form?
Yes.
You need to login to post a reply.
X