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
Discussions
You need to login to take part
Current Discussions
Calling variable from constructor in method to play/stop sound
By mattdodo, with 1 reply.
Replied to by danpost, almost 11 years ago:
You cannot use 'song.stop()' unless you first use 'song.play()' and have a reference to 'song' declared in the class. Therefore, in your 'play' method, use 'song.play()'. In your field declaration area, change line 13 to 'private GreenfootSound song;'; then in your constructor, change line 19 to 'song = new GreenfootSound(soundFile);'. You can remove lines 32, 33, 34, 38, and 43; as the 'loop' will only run once anyway. You can remove lines 47, 48, 49, 53, and 58; as the 'loop' will only run once anyway.
Spinning Crabs
By infant17, with 1 reply.
Replied to by danpost, almost 11 years ago:
It looks like you have your crab turning randomly about 5 to 6 times a second and up to a 45 degree turn left or right each time. You may want to reduce the change of a turn a bit. And maybe reduce the amount of turn also.
This is probably something really easy...
By jennnnay24, with 10 replies.
Last reply by jennnnay24, almost 11 years ago:
Write an int with a specified font
By Solringolt, with 2 replies.
Last reply by Solringolt, almost 11 years ago:
Ok I kinda solved my problem using the counter class imported thx
How can I make objects move diagonally in Greenfoot?
By QWERTY894, with 5 replies.
Last reply by danpost, almost 11 years ago:
You need to set values for 'direction' and 'speed' in the constructor for this object.
Class Sorting
By GregC246, with 8 replies.
Last reply by GregC246, almost 11 years ago:
Thanks :)
For danpost
By Game/maniac, with 5 replies.
Last reply by danpost, almost 11 years ago:
The image with the blue frame on the help screen is rendered with a size of (556, 580) on my system (I do not know why it would be different for anyone else). I did change the draw location for the actor images from an absolute offset from left of the frame image to an absolute offset from the center of the frame image (hope that helped).
Creating new levels in infinite numbers.
By Solringolt, with 2 replies.
Last reply by Solringolt, almost 11 years ago:
Thx for the tips! I added also the checkForNextLevel() in the act method to make it more easy. It looks like that now:
How do you gradually increase image size?
By QWERTY894, with 5 replies.
Last reply by danpost, almost 11 years ago:
You will probably find that the image will distort as it grows in size. This is because you are scaling the image multiple times. To avoid this, scale the original image each time. <Code Omitted>I added one to the y-location to prevent error creating an image of zero size. If you feel that the image is too large by the time it reaches the bottom of the screen, you can modify the code by using a ratio. In the above the ratio is one, which makes it full height of screen at the bottom.
Taking any help I can get...
By jennnnay24, with 2 replies.
Last reply by jennnnay24, almost 11 years ago:
Error: java.lang.OutOfMemoryError: Java heap space
By lgbrf, with 3 replies.
Last reply by lgbrf, almost 11 years ago:
Opening and closing it fixed it... i feel pretty silly for not trying that. Thanks guys :D
Could someone help me?
By bob10123, with 5 replies.
Last reply by OxiClean, almost 11 years ago:
"Still doesn't work" - Bob
Falling and jumping problem?
By thekidj, with 7 replies.
Last reply by thekidj, almost 11 years ago:
So I'd have if the following <Code Omitted>I'm not sure what I'd put in for X
Would someone be so kind?
By jennnnay24, with 2 replies.
Last reply by jennnnay24, almost 11 years ago:
The problem with 1 is that another requirement is that the crab's initial worms eaten have to be between 5 and 27
Shapes
By Gingervitis, with 4 replies.
Last reply by Gevater_Tod4711, almost 11 years ago:
Hmm... a realy strange link. Probably because of the brekets.
842
843
844
845
846
847
848
X