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
greenfoot world
By SANELE, with 1 reply.
Replied to by danpost, about 3 years ago:
SANELE wrote...
how can i make a round world?
All worlds are rectangular. However, you could create an object the size of the world with opaque edges and a large circular area of transparency for the "round world" to be in.
Sharing a value from variable between world
By Baransu69, with 3 replies.
Last reply by Baransu69, about 3 years ago:
dude tthnx , hope you have a good day
Multiple Worlds
By RandomStudent29, with 1 reply.
Replied to by danpost, about 3 years ago:
RandomStudent29 wrote...
im trying to make a puzzle game at school but i dont know how do change the different levels i created my try to do this was: << Code Omitted >> but it doesnt work For Context it is in my game ending code so instead of having Greenfoot.stop i tried Greenfoot.setWorld(welt2)
The code can be simply stated as the following: <Code Omitted>There is no reason to add an object into a world that is being dismissed by setting a new world. Both variables,
anzahlDiamant
and
anzah
Illegal start of expression
By Ilovemarcus, with 1 reply.
Replied to by danpost, about 3 years ago:
Ilovemarcus wrote...
im trying to make it so that it adds the 3 things randomly and while i was doing the prepare() method it kept saying illegal start of expression and idk what i am doing wrong. Im kind of new to java. << Code Omitted >>
There are several things to be fixed. Here is what I found: (1) lines 23 through 27 are misplaced; (2) prepare method starts before constructor block ends (constructor needs to close before a new method is introduced); (3) random y values use the wrong world dimension; For (1), remove those lines for now (lines 23 - 27). For (2), add the
Greenfoot 3.7.1a release fixes macOS 13 Ventura crash
By nccb, with no replies.
Just to let you know that for any of you who upgrade to macOS 13 (Ventura), Greenfoot has been reported to crash on load. We've just released a 3.7.1a hotfix for this on our download page. A new version of Greenfoot (3.8.0, I guess) will follow some time in the next few months with support for Java 17 and all the new Java 17 language features.
Changing Volume in a game?
By MyN@m31$J3ff2022, with 3 replies.
Last reply by danpost, about 3 years ago:
MyN@m31$J3ff2022 wrote...
there was coding in my MyWorld constructor class that dealt with starting the background music. It's the coding for adding the Ball() to the screen.
Question: why do you send a reference to the music to your new balls?
Sound is not beeing played
By N8TH1N6, with 4 replies.
Last reply by N8TH1N6, about 3 years ago:
danpost wrote...
N8TH1N6 wrote...
it still doesn't work, also with an mp3 is it maybe a problem with the sound file itself? It works outside of greenfoot
When you tried mp3, did you adjust line 5 to point to that file?
yes, the music works at a different computer idk why it doesnt works on mein
I wanna exchange Variables between my World subclass and actor subclass
By N8TH1N6, with 4 replies.
Last reply by N8TH1N6, about 3 years ago:
Ok I found the error myself in your line <Code Omitted> the ! made the error Thanks for the help : ) without you I wouldnt be able to get two player workin
Can you lock the mouse to the screen?
By s1ice, with no replies.
Or, is there any way to prevent the mouse from moving (like in FPS games) or keep it in one position?
Animating an Actor
By Foofoo99, with 1 reply.
Replied to by Foofoo99, about 3 years ago:
Never mind, all the images were the same image on accident.
Greenfoot don't detect the mouse
By RobinGG, with 1 reply.
Replied to by danpost, about 3 years ago:
RobinGG wrote...
I make a code that changes the color of a GreenfootImage if the mouse goes over it but the code doesn't seem to detect my mouse no matter what. << Code Omitted >>
How is the variable
mouse
defined? If set by something like this: <Code Omitted>then it will have the mouse state at the time the object of the class was created. Its state does not update automatically with time. You need to get a new
MouseInfo
object each time you want to acquire updated information about the mouse. That being said, havi
Actor touching another actor
By Guy68, with 5 replies.
Last reply by danpost, about 3 years ago:
Gabe1098 wrote...
I'm pretty sure you can do this << Code Omitted >>
Wanted was to go to another world -- not to remove an actor from the current world.
how can I add selected actor in another world?
By Guy68, with 4 replies.
Last reply by Guy68, about 3 years ago:
The problem is solved!!!! Thank you sooo much for your help!!
Greenfoot loading animation
By Guy68, with 2 replies.
Last reply by Guy68, about 3 years ago:
Thanks for your reply, but i resolved the problem.
how to avoid two object in same place when using random greenfoot
By vbh, with 3 replies.
Last reply by danpost, about 3 years ago:
vbh wrote...
thanks, is it possibel you can show me your code?
Run scenario and click on buttons at bottom of scenario window to view codes.
33
34
35
36
37
38
39
X