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
Stop all GreenfootSounds at once?
By lehrerfreund, with 7 replies.
Last reply by Spock47, over 2 years ago:
lehrerfreund wrote...
There is one flaw: If a not registered sound is called (...) a FileNotFoundException is thrown by the create-method.
Good catch! :)
Check for mouse click without act()-method running
By lehrerfreund, with 8 replies.
Last reply by RcCookie, over 2 years ago:
The other problem is that, because Greenfoot does not restart the JVM every time you press "Reset", threads will remain running until you restart Greenfoot. To fix this, we have to keep track of the actors that were created and stop threads of actors that are not on the active world. Putting it all together:
showing error in semicolon of stsement
By sashvanth, with 2 replies.
Last reply by sashvanth, over 2 years ago:
ok
Check an offset relative to my rotation
By AbdulrazaqAS, with 2 replies.
Last reply by AbdulrazaqAS, over 2 years ago:
danpost wrote...
AbdulrazaqAS wrote...
Hello, I want to always check what is in front of my actor before moving but i dont know how i will use the method getOneObjectAtOffset(int dx, int dy, Class<?> cls) or any other method to achieve that.
Use sine and cosine of rotation multipled by distance. Rotation will need to be converted to radians.
Thanks, it worked.
Error reading file when game is exported
By drhorriblejr, with 3 replies.
Last reply by danpost, over 2 years ago:
drhorriblejr wrote...
That's just the name of the file without the extension. I currently only have one level named test so it makes the path "levels/test.txt," and that path exists in the greenfoot project directory locally
Seems like you have everything in order. Maybe your file operations are not what javascript would allow.
Throws an exception if not logged in
By AbdulrazaqAS, with 7 replies.
Last reply by AbdulrazaqAS, over 2 years ago:
danpost wrote...
AbdulrazaqAS wrote...
I have uploaded the scenario, all the following classes are using UserInfo class; Area, FirstScreen, Board and Bomb.
Unfortunately, the
UserInfo
object may still be
null
even when storage is available. Therefore, after assigning the object to a variable using
getMyInfo
, check it for
null
before trying to work with the object (in each and every place you access it).
Thanks it works.
Not displaying User Image
By AbdulrazaqAS, with 5 replies.
Last reply by AbdulrazaqAS, over 2 years ago:
Ok, thank you all.
Flocking
By alex_rimbu, with 1 reply.
Replied to by Super_Hippo, over 2 years ago:
You can check out this one for a start:
https://www.greenfoot.org/scenarios/13501
change Image
By luGGas, with 2 replies.
Last reply by luGGas, over 2 years ago:
Oh, right. I forgot about that. Thanks
remove Object
By luGGas, with 3 replies.
Last reply by luGGas, over 2 years ago:
Passt schon habe es mit <Code Omitted>gelößt.
Move/Rotate multiple objects as one
By hfgd, with 3 replies.
Last reply by danpost, over 2 years ago:
hfgd wrote...
Yes, I have "block" that summons the tiles when created, falls down and can be controlled. But iI don't know how to rotate the tiles together with it
Show codes of "block" class.
BrickBreaker Game
By amberlin24, with 1 reply.
Replied to by RcCookie, over 2 years ago:
You don’t even need to remove the ball, instead put it back to the default position and reset the velocity.
Import Font from .ttf file
By crissty21, with 3 replies.
Last reply by danpost, over 2 years ago:
crissty21 wrote...
RcCookie wrote...
What error do you get?
I don't get an error. I just wanted to share it, so others won't spend a life time trying to figure it out. (as I did)
Just note that this will only work locally. It will not work when uploaded to the site as you cannot use the
java.awt
package here (the legacy version, which require a plug-in, may still work, however).
source code
By CYBERMAN99999, with 1 reply.
Replied to by Spock47, over 2 years ago:
It works fine for me. So you have to provide more information: What are you doing/where are you clicking? What is the reaction your computer displays/provides?
Scenario won't work on website but does in the app
By aleifericsson, with 9 replies.
Last reply by aleifericsson, over 2 years ago:
I have now changed every String.format() into String.valueOf() and now it works! Thank you so much for the help, guys!
30
31
32
33
34
35
36
X