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

danpost's Comments

Back to danpost's profile

All in all, other than the lack of 'return' statements at the end of blocks where 'getWorld().removeObject(this)' is used (which is causing a lot of 'IllegalStateException' throws), the code to this is not bad. The one thing, code-wise, that I did notice was your use of 'getWidth' in the 'paint' method of the world that should be 'getHeight'. The only other thing, which deals with the music, is that some of your sound files have tag information included with is causing ArrayIndexOutOfBoundsException throws. Re-saving the files without the tags should resolve that.
@SullyFish, start a discussion thread, show how you create the bar and how you are trying to use the bar (code posting is better in discussion threads).
@Peach, you are talking about a parameter in the 'getLetterImage' method. '@param' means that the following word is the name of a parameter. 'alphaChar' is the name I gave the String parameter. 'the letter to display on this new image' tells you that the new image created within the method will contain the glyph of the letter contained in the 'alphaChar' string. The calling method, with the expressions for the arguments already evaluated, would look like this: getLetterImage("L", java.awt.Color.black); You were asking about declaring a color variable. You declare one just like you declare any other object. java.awt.Color color = null; // declare variable to hold a color color = java.awt.Color.blue; // assignment example one color = new java.awt.Color(255, 64, 40); // assignment example two If using 'import java.awt.Color;', the previous would be: Color color = null; color = Color.blue; color = new Color(255, 64, 40);
@Peach, please start a new discussion if you have a question that does not pertain to a specific scenario.
@Unicus, read the description on this scenario. It tells you how you can view the source (check out the code).
Yes. Most, if not all, the root problems are coming up as incorrect (subtracting one from the score) when the answer entered was correct.
@drew.cameron, that is the effect of having transparency in the world background image.
What I meant was that you need to remove any and all transparency from the image of the background of your world.
You need to paint the background using 'fill()' after using clear' or after creating a new image for the background.