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

danpost's Comments

Back to danpost's profile

From source (comments are mine): ----------------- // importing class import java.util.Random; // creating Random object private static Random randomGenerator = new Random(); // using Random object public static int getRandomNumber(int limit) { return randomGenerator.nextInt(limit); }
As far as random, I used it here because I wanted to ensure a new random seed value each and every loading (greenfoot probably does it in a somewhat similar manner, but anyway ...).
The words omitted are the Hangman puzzle answers (not given for obvious reasons). Little difference between the two randoms. In fact, the method Greenfoot.getRandomNumber(int) uses java.util.Random in its implementation.
@Roshan123, it is just a matter of comparing user to a list during logging in. List is literal code that would be updated as needed. I used a BannedWorld set active if banned user tries to log in.
@349592576, please start a discussion thread on your thing to implement.
One issue may be the sound file names. Remove "sounds//" from ALL. Another issue may be the loading of the static sound file (I believe it was in the Scraps class). Try having it loaded after world instantiation.
So ... you are a cross-eyed ancient stone gray alien. Interesting.
@Roshan123, no imports required for this particular interface. Just the one line exactly as shown on 'About' page.
@Roshan123, it is its own thing. Just replace a new class' complete codes with that one line.