@Peach, obviously it is a call to 'addObject', a method in the World class that uses the signature 'addObject(actor, int, int)'. The actor is a new Letter object that is being placed within the array of letters declared near the top of the class. This line is found within a 'for' loop that iterates 'i' through the numbers 0 to 25 (for each letter of the alphabet). Notice in the scenario how I split the 26 letters into two rows of 13 letters each. The first int (the x-coordinate of where to place the letter actor) is '24+38*(i%13)'. This says to start at x-coordinate 24 and add 'i' factors of 38 (the distance between each letter). Taking the modulus 13 of 'i' starts the factor back at zero again for the second row. The second int (the y-coordinate of where to place the letter actor) is '510+30*(i/13)'. This says to start at y-coordinate 510 and add a factor of 30 for the second row ('i/13' will return 0 until 'i' reaches 13; then it will return one for the rest of the loop).
@Watchb, in the middle section of the act method, you will see where I detect a keystroke, make it uppercase and call the 'letterClicked' method if the key is between "A" and "Z" inclusive.
key.charAt(0) returns the ascii code value for the first (and only) character in the 'key' String object ('A' = 65 and 'Z' = 90); subtracting 65 from that gives a range of 0 to 25, which is the index of the Letter actor in the 'letters' array that contains the image of the 'key' letter. The 'letters' array contains the Letter actors that can be clicked on near the bottom of the screen. The Letters class can be found at the end of the Hangman class code.
@mandyg233, log in, click 'Run', move the mouse so that your button touches a smiley, click on a button (other that 'New Game') along the bottom of high score screen.
2014/5/24
Hangman
2014/5/24
Hangman
2014/5/24
Hangman
2014/5/23
Hangman
2014/5/23
Hangman
2014/5/22
Hangman
2014/5/21
Hangman
2014/5/21
Space Smileys
2014/5/20
Hangman