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
losing energy
By infant17, with 31 replies.
Last reply by jennnnay24, over 11 years ago:
After reading over what you have posted, I think we are in the same class! Haha.
everything is selected in yellow
By Nike.Sprite, with 2 replies.
Last reply by Nike.Sprite, over 11 years ago:
Ok tnx,(y) I just tried to close the window of my class, I didn't think of close the full program while I was busy working on it ;)
Getting user input
By henrYoda, with 3 replies.
Last reply by danpost, over 11 years ago:
You can use JOptionPane objects to get user input; or you can program it yourself to better control how it works. See the Java tutorials on how to use JOptionPanes.
Crab energy
By jennnnay24, with no replies.
There have been a few discussions about crab energy but I still have not been able to put anything together and figure it out for myself. I need to make the crab lose 1/20 of a worm (energy) with every move. This is what I have... <Code Omitted>
Stopping the game..
By jennnnay24, with 2 replies.
Last reply by jennnnay24, over 11 years ago:
Yes, that worked! Thank you soo much. I'm still trying to learn all of this...
Error message
By infant17, with 10 replies.
Last reply by JetLennit, over 11 years ago:
Hadn't noticed that.....
Calling variable from constructor in method to play/stop sound
By mattdodo, with 1 reply.
Replied to by danpost, over 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, over 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, over 11 years ago:
Write an int with a specified font
By Solringolt, with 2 replies.
Last reply by Solringolt, over 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, over 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, over 11 years ago:
Thanks :)
For danpost
By Game/maniac, with 5 replies.
Last reply by danpost, over 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, over 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, over 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.
847
848
849
850
851
852
853
X