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
showing error in semicolon of stsement
By sashvanth, with 2 replies.
Last reply by sashvanth, about 3 years ago:
ok
Check an offset relative to my rotation
By AbdulrazaqAS, with 2 replies.
Last reply by AbdulrazaqAS, about 3 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, about 3 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, about 3 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, about 3 years ago:
Ok, thank you all.
Flocking
By alex_rimbu, with 1 reply.
Replied to by Super_Hippo, about 3 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, about 3 years ago:
Oh, right. I forgot about that. Thanks
remove Object
By luGGas, with 3 replies.
Last reply by luGGas, about 3 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, about 3 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, about 3 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, about 3 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, about 3 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, about 3 years ago:
I have now changed every String.format() into String.valueOf() and now it works! Thank you so much for the help, guys!
I want to pass the score from my MyWorld world to my GameOver world
By KCee, with 3 replies.
Last reply by Spock47, over 3 years ago:
KCee wrote...
I added the code you wrote but it still doesn't pass on the score to the GameOver world
Well, it does, but you have to also use it, e.g. adding in the constructor: <Code Omitted>
How to add a collision to an object?
By shindayoni, with 7 replies.
Last reply by Spock47, over 3 years ago:
Like said: The solution is that the knight has to start in a free position and not already in the trees. However, here is a version that will work even if the player was stuck before the movement. Note that it is not a very efficient implementation and if there is not enough space for the player in the direction in which the player tries to unstuck, it will just stay at the edge of the world. Example: If the given image actually shows the bottom of the world, then there is not enough space for the Knight below the trees, therefore he cannot be unstuck. You need to make more space for her/h
35
36
37
38
39
40
41
X