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

Peach's Comments

Back to Peach's profile

PeachPeach

2014/5/24

@danpost, thank you for the explanation. If I wanted to have all the the 26 letters in 1 row, what would the code be like? do I just delete "(i%13)" and "(i/13)" from the code? so like this: addObject(letters[i] = new Letter(i), 24+38, 510+30; thank you!
PeachPeach

2014/5/24

@Danpost, in this line of the code "addObject(letters[i] = new Letter(i), 24+38*(i%13),510+30*(i/13));" what does "24+38*(i%13),510+30*(i/13))" mean?
PeachPeach

2014/5/20

sorry typo. i meant to type "public class hangman extends World"
PeachPeach

2014/5/19

do you need to write "private int baseX;" under "public class WhiteBoard extends World"
PeachPeach

2014/5/19

I don't really understand this part of the code, could you please explain it? word = words.nextWord(); int baseX = getWidth()/2 - word.length() * 18 + 9; bg.setColor(Color.black); for (int i=0; i<word.length(); i++) { bg.fillRect(baseX+36*i, getHeight()-10, 24, 3); what is baseX?
PeachPeach

2014/5/16

when I write this, private GreenfootImage getLetterImage("A",java.awt.Color.black) a message saying "illegal start of type" keeps popping up. how do I fix it? also, in the method "return new GreenfootImage("A", 36, black, null);" what does the number 36 represent? Also,
PeachPeach

2014/5/16

so I would need 26 getLetterImage methods for all 26 letters of the alphabet? eg. getLetterImage("A", java.awt.Color.black); getLetterImage("B", java.awt.Color.black); getLetterImage("C", java.awt.Color.black); etc thanks
PeachPeach

2014/5/14

i don't understand what this means "param alphaChar the letter to display on this new image" what is the parameter supposed to be?
PeachPeach

2014/5/14

how do you declare a color variable eg. black or blue